Ejemplo n.º 1
0
 public RelatedMatch RelatedMatch(string text, int startIndex, TextLengthChanger owner = null)
 {
     var sw = Stopwatch.StartNew();
     var match = _regex.Match(text, startIndex);
     Interlocked.Add(ref PerfomanceCounter, sw.ElapsedTicks);
     return new RelatedMatch(match, owner);
 }
Ejemplo n.º 2
0
 public RelatedMatch(Match match, TextLengthChanger owner = null)
 {
     StartIndex = match.Index;
     Length = match.Length;
     Success = match.Success;
     Groups = match.Groups;
     if (owner != null) SetOwner(owner);
 }
Ejemplo n.º 3
0
 public List<RelatedMatch> RelatedMatches(string text, TextLengthChanger owner = null)
 {
     var result = new List<RelatedMatch>();
     var m = RelatedMatch(text, 0, owner);
     while (m.Success)
     {
         result.Add(m);
         m = RelatedMatch(text, m.StartIndex + m.Length, owner);
     }
     if (result.Count == 0) result.Add(m);
     return result;
 }