Reputation: 139
I need to validate phone numbers. it must have a "+" sign followed by [0-9].
I need something like /^ + . [0-9]*$/
I don't know how to implement the "+" sign and how to have it validate only once. Concerning the length It does not matter for my purpose.
Upvotes: 0
Views: 27
Reputation: 5488
This should work -
/^\+[0-9]+$/
and test it using test()
like this -
> /^\+[0-9]+$/.test("+9009900")
true
Upvotes: 1