开发者

RegularExpressionValidator syntax for multiline TextBox?

开发者 https://www.devze.com 2023-03-25 19:41 出处:网络
I have a multiline TextBox for which any of the following inputs are valid: Empty string (the text can optionally be blank upon submit).

I have a multiline TextBox for which any of the following inputs are valid:

  1. Empty string (the text can optionally be blank upon submit).
  2. A single n开发者_如何学Goumeric (0 - 9) string, up to 9 digits long.
  3. Multiple numeric strings, each up to 9 digits long, each separated by carriage return (\r) and/or newline (\n).

What regular expression will enable me to validate these criteria, using a RegularExpressionValidator control? I'm currently experimenting with the excellent Expresso tool, but would appreciate insight in evaluating these multiple criteria efficiently at once.


^(?:\d{1,9}(?:[\r\n]\d{1,9})*)?$
0

精彩评论

暂无评论...
验证码 换一张
取 消