<asp: RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace

Is there an easy way to use a control RegularExpressionValidatorwhen ignoring spaces?

I can use a custom validation element with Regexand IgnorePatternWhitespace, but it would be nice to have an option in the control RegularExpressionValidator.

+3
source share
2 answers

Surround your regex with

(? x :)

therefore, "ab c" becomes "(? x: abc)

+2
source

, javascript, , .Net, javascript. , .IgnorePatterWhitespace - .

0

Source: https://habr.com/ru/post/1696816/


All Articles