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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -