正则表达式:"<100 or >50 or <1000" 怎么写才能提取的各个or前面的数据,我用".*or"的话会把第二个or之前的字符串全部取出的。求教!
如题求教!
[解决办法]
(?i).*?or
[解决办法]
try...
string test = " <100 or >50 or <1000"; Regex reg = new Regex(@"(?isn)(?<c>((?!or).)+)(or|$)"); MatchCollection mc = reg.Matches(test); foreach (Match m in mc) { richTextBox2.Text += m.Groups["c"].Value + "\n"; }