Ejemplo n.º 1
0
        //извлечь индексы и размер строк
        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);
        }
Ejemplo n.º 2
0
 //извлечь индексы и размер строк
 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;
 }