//извлечь индексы и размер строк public List <SubstringInfo> ExtractSubstringInfo(string input, string pattern) { MatchCollection result = Regex.Matches(input, pattern, RegexOptions.IgnoreCase); List <SubstringInfo> list = new List <SubstringInfo>(); foreach (Match match in result) { SubstringInfo info = new SubstringInfo(); info.Index = match.Index; info.Length = match.Length; list.Add(info); } return(list); }
//извлечь индексы и размер строк public List<SubstringInfo> ExtractSubstringInfo(string input, string pattern) { MatchCollection result = Regex.Matches(input, pattern, RegexOptions.IgnoreCase); List<SubstringInfo> list = new List<SubstringInfo>(); foreach (Match match in result) { SubstringInfo info = new SubstringInfo(); info.Index = match.Index; info.Length = match.Length; list.Add(info); } return list; }