I want to write a regular expression. Here is my basic requirement:
-) inside these 11 numbers. Here is the regular expression that I wrote:
\d{11}[^-]
Examples:
a) 12345654321 => Valid
b) 123-4567890 => Invalid
c) -1234567890 => Invalid
d) 1234567890- => Invalid
I didn't get the proper result. How should I correct it?
^\d{11}$
this should do it....... With anchors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With