jeudi 5 janvier 2017

Regular Expression to validate the Country code of mobile number in javascript

I need a regular expression that will test the input

  1. Should start with only one + symbol or optional ( + should not come in between )
  2. should not contain alphabets and any other special character
  3. Should not contain consecutive + symbols

eg

  • +91 (valid)
  • 91 (valid)
  • ++91 (invalid)
  • +9+1 (invalid)
  • 91+ (invalid)
  • +91&*& (invalid)

Need your inputs on this . Thanks




Aucun commentaire:

Enregistrer un commentaire