javascript - Regex for international numbers - no space -
I am trying to create a regEx which will have the optional '+' as the first character and then accept all the digits After doing this, make sure no spaces are allowed
I have tried the following, but it does not seem to work:
New RegExp (/ ^ \ +? \ $$$);
Looks like you want something like that,
< Code> New RegExp (/ ^ \?? \ D + $ /); Change the location with + in your regex \ d + matches one or more digits.
Comments
Post a Comment