62,254
社区成员
发帖
与我相关
我的任务
分享 string str = @" Now you have 1 minute to prepare. What aspect of Mr. Zhang interests you most? You may compare your high school math teacher with Mr. Zhang. Talk about three detailed facts to show their difference.";
Regex reg = new Regex(@"(?<= )(?!Now| ).+?(?= |$)");
foreach (Match m in reg.Matches(str))
Console.WriteLine(m.Value);
string str = " You may compare your high school math teacher with Mr. Zhang.";
Regex reg = new Regex(@"(?: )*((?:(?! ).)+)");
Console.WriteLine("{0}\r\n{1}", reg.Match(str).Value, reg.Match(str).Groups[1].Value);
string listIssue = " What aspect of Mr. Zhang interests you most";
Regex re = new Regex(@"( )+(?<text>.*)", RegexOptions.IgnoreCase);
Match mc = re.Match(listIssue);
while (mc.Success)
{
Response.Write(mc.Groups["text"] + "<br/>");
mc = mc.NextMatch();
}
Response.End();