/// <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));
}