protected override void AppendCharacterRangeToBracketExpression( char startOfCharacterRange, char endOfCharacterRange) { WildcardPatternToRegexParser.AppendCharacterRangeToBracketExpression( _bracketExpressionBuilder, startOfCharacterRange, endOfCharacterRange); }
public static PatternElement[] Parse( WildcardPattern pattern, CharacterNormalizer characterNormalizer) { var parser = new MyWildcardPatternParser { _characterNormalizer = characterNormalizer, _regexOptions = WildcardPatternToRegexParser.TranslateWildcardOptionsIntoRegexOptions(pattern.Options), }; WildcardPatternParser.Parse(pattern, parser); return(parser._patternElements.ToArray()); }
/// <summary> /// Parses a <paramref name="wildcardPattern"/> into a <see cref="Regex"/> /// </summary> /// <param name="wildcardPattern">Wildcard pattern to parse</param> /// <returns>Regular expression equivalent to <paramref name="wildcardPattern"/></returns> public static Regex Parse(WildcardPattern wildcardPattern) { WildcardPatternToRegexParser parser = new WildcardPatternToRegexParser(); WildcardPatternParser.Parse(wildcardPattern, parser); try { return(new Regex(parser._regexPattern.ToString(), parser._regexOptions)); } catch (ArgumentException) { throw WildcardPatternParser.NewWildcardPatternException(wildcardPattern.Pattern); } }
protected override void AppendLiteralCharacterToBracketExpression(char c) { WildcardPatternToRegexParser.AppendLiteralCharacterToBracketExpression( _bracketExpressionBuilder, c); }