Regex.Match不改变Tool工具包解决自有分割,增加'

//v.getCondition()为分割补充查询条件

//v.getCondition()
string Condition = v.getCondition();

用正则获取DRAW.customer_col_3的对应值

//S_SEC_ID.getValue() != "" ?  S_SEC_ID.getValue() + "&'" : S_SEC_ID.getValue()  //前端增加&用来判断是此字段
string result = System.Text.RegularExpressions.Regex.Match(Condition, "(?<=DRAW.customer_col_3 like).*?(?=&'')").Value;  //值为空时不给判断符号  //toUpperCase()可以变为大写
//s = Regex.Replace(s, @"\r\n", " ");
if (result != "")//有作业对象
{
string result2 = " '" + result.Replace("'", "").Replace(" ","");
Condition = Condition.Replace(result, result2).Replace("&'", "");
}

猜你喜欢

转载自www.cnblogs.com/chuyunno1/p/10578901.html