I have a multiline TextBox for which any of the following inputs are valid:
- Empty string (the text can optionally be blank upon submit).
- A single n开发者_如何学Goumeric (0 - 9) string, up to 9 digits long.
- 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})*)?$
精彩评论