private static List <string> GetTheMatches(string inputStr)
        {
            List <string> retval = new List <string>();

            int[] lengths = new int[] { 7, 8 };
            for (int i = 0; i < lengths.Length; i++)
            {
                string tmp = new System.Text.RegularExpressions.Regex("(\\d{" + lengths[i] + ",})").Match(inputStr.ToString()).ToString();
                while (tmp.Length >= lengths[i])
                {
                    retval.Add(tmp.Substring(0, lengths[i]));
                    tmp = tmp.Remove(0, 1);
                }
            }
            return(retval);
        }
示例#2
0
        private static List <string> GetTheMatches(string inputStr)
        {
            List <string> retval = new List <string>();
            string        tmp    = new System.Text.RegularExpressions.Regex("(\\d{7,})").Match(inputStr.ToString()).ToString();

            while (tmp.Length >= 7)
            {
                retval.Add(tmp.Substring(0, 7));
                tmp = tmp.Remove(0, 1);
            }
            tmp = new System.Text.RegularExpressions.Regex("(\\d{8,})").Match(inputStr.ToString()).ToString();
            while (tmp.Length >= 8)
            {
                retval.Add(tmp.Substring(0, 8));
                tmp = tmp.Remove(0, 1);
            }
            return(retval);
        }