I would like to validate 8 digit phone numbers that start with a double digit greater than 2.
eg: 33452334 would validate while 32222222 would not.
This is what I tried but it's not working since it doesn't make sure the two first digits are similar:
^[3-9]{2}\d{6}$
Use this regex:
^([3-9])\1\d{6}$
( )
to capture,\1
to use a back reference.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