예제 #1
0
 static BlockMatch GetMatch(BlockMatch m1, BlockMatch m2)
 {
     return(m1 == null
             ? m2 == null
                 ? null
                 : m2
             : m2 == null
                 ? m1
                 : m1.Match.Index < m2.Match.Index ? m1 : m2);
 }
예제 #2
0
        public static BlockMatch GetMatch(string input)
        {
            if (_regexCollection == null)
            {
                BlockMatcher.Setup();
            }
            BlockMatch result = null;

            foreach (var regex in _regexCollection)
            {
                result = BlockMatcher.GetMatch(result, regex.Match(input));
            }
            return(result);
        }