What does the regular expression "\d{1,6}" (used in an ASP.NET MVC route as parameter constraint) check for/allow?
"100,000" is a number with 6 digits.
Bill the Lizard
2009-09-25 00:57:32
So is 1.623e-12 but that's *also* being picky :-)
paxdiablo
2009-09-25 01:00:57
Sorry, I don't mean to be picky, but regular expressions are very picky about what they will match. :)
Bill the Lizard
2009-09-25 01:09:04
No, you *should* be picky. Engineering is, after all, meant to be an exact science. Otherwise I would have majored in English Lit.
paxdiablo
2009-09-25 01:41:07
+16
A:
That will match 1-6 consecutive occurrences of any of the digits 0-9 (not necessarily the same digit).
Bill the Lizard
2009-09-25 00:54:49
+1
A:
\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
xrath
2009-09-25 02:33:41