给出一个位置变量 int no; no = text.indexof(":")然后用Substring 方法text.Substring(no+1,15);
string text = @"public partial class ClassFuncRights : ClassAuthenticate {"; text = System.Text.RegularExpressions.Regex.Match(text, @"(?<=class\s+)\w+(?=\s*:)", RegexOptions.IgnoreCase).Value;
no = text.indexof(":")然后用Substring 方法text.Substring(no+1,15);
text = System.Text.RegularExpressions.Regex.Match(text, @"(?<=class\s+)\w+(?=\s*:)", RegexOptions.IgnoreCase).Value;