求一个正则表达式,请高手来帮帮忙阿
匹配形如这样的:<start> ......<end>也就是 以“<start>”开头,以“<end>”结尾,中间任意个任意字符。
请帮帮我啊,因为平时问题问的太多,就这10分了,不要嫌弃阿。
匹配形如这样的:<start> ......<end>也就是 以“<start>”开头,以“<end>”结尾,中间任意个任意字符。
请帮帮我啊,因为平时问题问的太多,就这10分了,不要嫌弃阿。
Text = Regex.Match(S, "<start>(?!<start>|<end>)(.*?)<end>").Result("$1");
缩短飞速地方
<end>
regex r=new regex(@"^<start>(.|\s)*<end>$")
缩短飞速地方
<end>
是从文本里读出来的,然后到richTextBox里的
if (m.Success)
{
string resultStr = m.Value;
}匹配多个的用这个MatchCollection mc = Regex.Matches(yourStr, @"<start>[\s\S]*?<end>", RegexOptions.IgnoreCase);
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n"; //匹配结果
}