日期:2014-05-18  浏览次数:21257 次

正则表达式:"<100 or >50 or <1000" 怎么写才能提取的各个or前面的数据,我用".*or"的话会把第二个or之前的字符串全部取出的。求教!
如题求教!

------解决方案--------------------
(?i).*?or
------解决方案--------------------
try...


C# code
            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";
            }