Ejemplo n.º 1
0
            public static PatternElement[] Parse(WildcardPattern pattern, CharacterNormalizer characterNormalizer)
            {
                var parser = new MyWildcardPatternParser {
                    _characterNormalizer = characterNormalizer,
                    _regexOptions        = WildcardPatternToRegexParser.TranslateWildcardOptionsIntoRegexOptions(pattern.Options)
                };

                Parse(pattern, parser);
                return(parser._patternElements.ToArray());
            }
        public static Regex Parse(WildcardPattern wildcardPattern)
        {
            Regex regex;
            var   parser = new WildcardPatternToRegexParser();

            Parse(wildcardPattern, parser);
            try {
                regex = new Regex(parser.regexPattern.ToString(), parser.regexOptions);
            }
            catch (ArgumentException) {
                throw NewWildcardPatternException(wildcardPattern.Pattern);
            }
            return(regex);
        }
 public static Regex Parse (WildcardPattern wildcardPattern)
 {
     Regex regex;
     var parser = new WildcardPatternToRegexParser();
     Parse(wildcardPattern, parser);
     try {
         regex = new Regex(parser.regexPattern.ToString(), parser.regexOptions);
     }
     catch (ArgumentException) {
         throw NewWildcardPatternException(wildcardPattern.Pattern);
     }
     return regex;
 }
Ejemplo n.º 4
0
 protected override void AppendLiteralCharacterToBracketExpression(char c)
 {
     WildcardPatternToRegexParser.AppendLiteralCharacterToBracketExpression(_bracketExpressionBuilder, c);
 }
Ejemplo n.º 5
0
 protected override void AppendCharacterRangeToBracketExpression(char startOfCharacterRange, char endOfCharacterRange)
 {
     WildcardPatternToRegexParser.AppendCharacterRangeToBracketExpression(_bracketExpressionBuilder, startOfCharacterRange, endOfCharacterRange);
 }