开发者

RegularExpressionValidator syntax for multiline TextBox?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜