I am trying to create a regular expression to force users to enter only phone numbers of the format accepted by Twilio API. With prefix of form +40 (eg.: +40123456789) not 0040 and without delimiters. Only the character + and numbers.
I came up with this so far \+\d{10,}
.
Is this a good one? If not can you please improve on it?
Thanks.
EDIT:
- the phone number should contain the prefix of the country and the phone number
- the prefix is not fixed to +40(Romanian prefix). That is just an example.
- the prefix should start with
+
not with00
- the number should not have delimiters
Good example: +40123456789 Bad example: (074) 352-7819