ToRegexPattern() public abstract method

Converts RegexNode to a Regex pattern string.
public abstract ToRegexPattern ( ) : string
return string
Esempio n. 1
0
 /// <summary>
 /// Generates a Regex object from a single RegexNode and applies a combination of RegexOptions to it.
 /// </summary>
 /// <param name="regexOptions">Combination of RegexOption flags to be applied to the Regex.</param>
 /// <param name="rootNode">Root node.</param>
 /// <returns>A new instance of Regex which corresponds to the specified RegexNode.</returns>
 public static Regex Build(RegexOptions regexOptions, RegexNode rootNode)
 {
     if (rootNode == null)
     {
         throw new ArgumentNullException("rootNode");
     }
     return(new Regex(rootNode.ToRegexPattern(), regexOptions));
 }
Esempio n. 2
0
 /// <summary>
 /// Generates a Regex object from a single RegexNode and applies a combination of RegexOptions to it.
 /// </summary>
 /// <param name="regexOptions">Combination of RegexOption flags to be applied to the Regex.</param>
 /// <param name="rootNode">Root node.</param>
 /// <returns>A new instance of Regex which corresponds to the specified RegexNode.</returns>
 public static Regex Build(RegexOptions regexOptions, RegexNode rootNode)
 {
     if (rootNode == null)
     {
         throw new ArgumentNullException("rootNode");
     }
     return new Regex(rootNode.ToRegexPattern(), regexOptions);
 }