Reputation: 353
I have created a regex to match a phone number using the following one:
^[+0-9():.]+$
But this regex matches a number that starts with a dot too. My usecase is to modify the above regex such that it matches a number that doesnt starts with a dot but contians a dot.
Upvotes: 1
Views: 1626
Reputation: 5028
Try using this regex:
(^(?![.])[+0-9():.]+$)
You can also specify how many numbers you need in the second part of the regex
Upvotes: 2