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!
```
public RegularExpressionValidator(Regex regex) : base(() => Messages.regex_error) {
expression = regex.ToString();
this.regex = regex;
}
```
Plus the associated Matches extension
Comments: Great, thanks!