是否有一种简单的方法可以RegularExpressionValidator在忽略空白的同时使用控件?
RegularExpressionValidator
我可以使用带有Regexand的自定义验证器控件IgnorePatternWhitespace,但最好_Stack Overflow中文网
Regex
IgnorePatternWhitespace
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用带有Regexand的自定义验证器控件IgnorePatternWhitespace,但最好
我可以使用带有Regexand的自定义验证器控件IgnorePatternWhitespace,但最好在RegularExpressionValidator控件中有一个选项。
请记住,正则表达式验证器也希望使用 javascript 进行验证,因此您要确保您的表达式适用于 .Net 和 javascript 正则表达式引擎。这意味着使用 .IgnorePatterWhitespace 并不是最好的主意。
包围你的正则表达式
(?X: )
所以 "ab c" 变成 "(?x:abc)