Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Just now noticed how both [\\d]+ and [0-9]+ should be just \\d+ (well, some may find [0-9]+ more readable). I'm not going to edit the question, but you may want to fix this answer. Commented Apr 17, 2013 at 9:59
  • @hyde - Good catch. Technically they're not quite the same thing - \d will match anything that's considered a number, even in other numbering systems (Chinese, Arabic, etc.), while [0-9] will just match the standard digits. I did standardize on \\d, though, and factored it into the optionalDecimal pattern. Commented Apr 17, 2013 at 13:30