Example #1
0
        public IMatch Match(string text)
        {
            IMatch match = new SuccesMatch(pattern.Match(text).RemainingText());

            return(pattern.Match(text).Success()
               ? match
               : new SuccesMatch(text));
        }
Example #2
0
        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);
        }
Example #3
0
        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()));
        }