mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-09-29 07:10:37 -04:00
Resolved issue # 38
The positive integers are the numbers 1, 2, 3, 4, ... , sometimes called the natural numbers or counting numbers. Positive integers are denoted as Z+. old regex was also allowing 0, which is not a positive number.
This commit is contained in:
parent
250d538b3c
commit
340d4b4e86
@ -470,7 +470,7 @@ line. And because of `m` flag now regular expression engine matches pattern at t
|
||||
|
||||
## Bonus
|
||||
|
||||
* *Positive Integers*: `^\d+$`
|
||||
* *Positive Integers*: `^[1-9]\d*$`
|
||||
* *Negative Integers*: `^-\d+$`
|
||||
* *US Phone Number*: `^+?[\d\s]{3,}$`
|
||||
* *US Phone with code*: `^+?[\d\s]+(?[\d\s]{10,}$`
|
||||
|
Loading…
x
Reference in New Issue
Block a user