5
请教一个字符串匹配的正则表达式问题
// TODO Don't hardcode this
List.Add("public");
//\"([^\"]*)\"
Regex oldRegex = new Regex("(?<=\").*(?=\")");
Regex newRegex = new Regex("\"([^\\\"][^\"]*?)\"");
var html = "<span class=\"int\">'" + intStr + "</span>";
比如有上面这段文本,现在需要匹配如下几种情况:
1. //(双斜杠)之后的数据
1. ""(双引号)或者'(单引号)之间的数据(如果双引号之间,则忽略其中的转义字符\"和')
例如:
上面代码部分最后一行,匹配出的结果应该是:
<span class=\"int\">'"
"</span>"
这两个
z1223558
2019/09/04 10:19- 正则表达式
- 点赞
- 收藏
- 回答
1个回复
