Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<asp:RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace

Tags:

regex

asp.net

Is there an easy way of using the RegularExpressionValidator control while ignoring white space?

I can use a custom validator control with Regex and IgnorePatternWhitespace, but it would be good to just have an option in the RegularExpressionValidator control.

like image 970
Joe Ratzer Avatar asked Dec 29 '25 05:12

Joe Ratzer


1 Answers

Surround your regex with

(?x: )

so "a b c" becomes "(?x:a b c)