Reputation: 77329
What does the regular expression "\d{1,6}" (used in an ASP.NET MVC route as parameter constraint) check for/allow?
Upvotes: 0
Views: 20166
Reputation: 854
\d means a single decimal character. 0~9.
{minimum-length, maximum-length} means a precede expression (\d in this case) will be followed repeatedly.
As a result, your expression \d{1,6} would match any of them.
0 12 874 4757 48727 557473
Upvotes: 1
Reputation: 405765
That will match 1-6 consecutive occurrences of any of the digits 0-9 (not necessarily the same digit).
Upvotes: 19