//return index and string length from text by pattern
        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);
        }
 //return index and string length from text by pattern
 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;
 }