Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

Commented Issue: Allow passing a Regex object to the RegularExpressionValidator [7121]

$
0
0
Sometimes one would like to pass a regex object, possibly to pass RegexOptions, or because the Regex was already built for other reasons. A constructor like the following would be very helpful:

```
public RegularExpressionValidator(Regex regex) : base(() => Messages.regex_error) {
expression = regex.ToString();
this.regex = regex;
}
```

Plus the associated Matches extension
Comments: Great, thanks!

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>