Ejemplo n.º 1
0
        public DetailRegexMatches(string input, Match match)
        {
            this.input = input;
            this.found = false;
            List <DetailRegexMatch> matchList = new List <DetailRegexMatch>();

            while (match.Success)
            {
                this.found = true;
                DetailRegexMatch regexMatch = new DetailRegexMatch();
                regexMatch.indexMatch  = match.Index;
                regexMatch.lengthMatch = match.Length;
                regexMatch.value       = match.Value;
                List <DetailRegexGroup> groupList = new List <DetailRegexGroup>();
                foreach (Group group in match.Groups)
                {
                    DetailRegexGroup regexGroup = new DetailRegexGroup();
                    regexGroup.indexMatch  = group.Index;
                    regexGroup.lengthMatch = group.Length;
                    regexGroup.value       = group.Value;
                    List <DetailRegexCapture> captureList = new List <DetailRegexCapture>();
                    foreach (Capture capture in group.Captures)
                    {
                        DetailRegexCapture regexCapture = new DetailRegexCapture();
                        regexCapture.indexMatch  = capture.Index;
                        regexCapture.lengthMatch = capture.Length;
                        regexCapture.value       = capture.Value;
                        captureList.Add(regexCapture);
                    }
                    regexGroup.captures = captureList.ToArray();
                    groupList.Add(regexGroup);
                }
                regexMatch.groups = groupList.ToArray();
                matchList.Add(regexMatch);
                match = match.NextMatch();
            }
            matches = matchList.ToArray();
        }
Ejemplo n.º 2
0
 public DetailRegexMatches(string input, Match match)
 {
     this.input = input;
     this.found = false;
     List<DetailRegexMatch> matchList = new List<DetailRegexMatch>();
     while (match.Success)
     {
         this.found = true;
         DetailRegexMatch regexMatch = new DetailRegexMatch();
         regexMatch.indexMatch = match.Index;
         regexMatch.lengthMatch = match.Length;
         regexMatch.value = match.Value;
         List<DetailRegexGroup> groupList = new List<DetailRegexGroup>();
         foreach (Group group in match.Groups)
         {
             DetailRegexGroup regexGroup = new DetailRegexGroup();
             regexGroup.indexMatch = group.Index;
             regexGroup.lengthMatch = group.Length;
             regexGroup.value = group.Value;
             List<DetailRegexCapture> captureList = new List<DetailRegexCapture>();
             foreach (Capture capture in group.Captures)
             {
                 DetailRegexCapture regexCapture = new DetailRegexCapture();
                 regexCapture.indexMatch = capture.Index;
                 regexCapture.lengthMatch = capture.Length;
                 regexCapture.value = capture.Value;
                 captureList.Add(regexCapture);
             }
             regexGroup.captures = captureList.ToArray();
             groupList.Add(regexGroup);
         }
         regexMatch.groups = groupList.ToArray();
         matchList.Add(regexMatch);
         match = match.NextMatch();
     }
     matches = matchList.ToArray();
 }