public IMatch Match(string text) { IMatch match = new SuccesMatch(pattern.Match(text).RemainingText()); return(pattern.Match(text).Success() ? match : new SuccesMatch(text)); }
public IMatch Match(string text) { IMatch match = new SuccesMatch(text); foreach (var pattern in patterns) { match = pattern.Match(match.RemainingText()); if (!match.Success()) { return(new FailedMatch(text)); } } return(match); }
public IMatch Match(string text) { if (string.IsNullOrEmpty(text)) { return((IMatch) new SuccesMatch(text)); } IMatch match = new SuccesMatch(text); while (match.Success()) { match = pattern.Match(match.RemainingText()); } return((IMatch) new SuccesMatch(match.RemainingText())); }