I want to create regex which should have following things:
- The regex is for validating phone numbers so it should have minimum length 10 digits and maximum length of 12 digits except special symbols like
+
,-
and space. - Plus sign only allowed at start.
I tried below regex but not working for me.
^\+[-0-9 ]\d{10,12}$
Please advice me how I can achieve this. Below are few examples for which I need to write regex:
+12 1234567890
+12 12 345 567 89
+12 123-455-6789
+9712345567
In the question which was said to be a duplicate, do not have any information regarding restricting the length upto 12 numbers.