A regular expression to match a positive integer value like 10, 20, 100, etc.
/^\d+$/
Matches:
- 0
- 100
- 2000
Non-matches:
- 123.45
- -100
- abcd
See Also:
Rate This Regex
User Review
( votes)Expression Flags
Flags | Description |
---|---|
i |
Ignore case sensitive. |
g |
Allows global search. |
m |
Allows multiline search. |