zoukankan      html  css  js  c++  java
  • C#正则表达式 委托替换

          MatchEvaluator myEvaluator = new MatchEvaluator(ReplaceCC);

                string sRegexInput = @"<INPUT.*?value=([0-9\.]*).*?>";  //替换input
                string sRegexSel = "<SELECT.*?selected>(.*?)</OPTION>.*?</SELECT>"; //替换sel

                string strWithOutInput = Regex.Replace(hnExcel.Value, sRegexInput, myEvaluator);
                string strWithOutSelect = Regex.Replace(strWithOutInput, sRegexSel, myEvaluator);

                sw.Write(header + strWithOutSelect);

    protected static string ReplaceCC(Match m)
            {
                return m.Groups[1].Value;
            }

  • 相关阅读:
    个人所得税避税的10种方法
    营业税
    融资租赁
    会计等式
    公司公积金
    fixed语句
    自由之路
    $or操作符
    $in 操作符
    Redis 字典的实现
  • 原文地址:https://www.cnblogs.com/wucg/p/1701076.html
Copyright © 2011-2022 走看看