public static string Render(this AstRegexOperator @operator) { return(@operator switch { AstRegexOperator.Find => "$regexFind", AstRegexOperator.FindAll => "$regexFindAll", AstRegexOperator.Match => "$regexMatch", _ => throw new InvalidOperationException($"Unexpected regex operator: {@operator}.") });
public AstRegexExpression( AstRegexOperator @operator, AstExpression input, AstExpression regex, AstExpression options = null) { _operator = @operator; _input = Ensure.IsNotNull(input, nameof(input)); _regex = Ensure.IsNotNull(regex, nameof(regex)); _options = options; }