I am trying write a PHP regex to find numbers only that are exactly 3 digits long and start with a 6. So there should be no other symbols – just a 3-digit number. I know
^6
will validate if it leads with a 6 and the following will validate it is exactly 3 digits long
^\d{3}$
but I can’t find a way to combine these two expressions together into a single regex. Anyone know how I can combine the expressions? Thanks!
You are close :), now you just need to make 6 part of the expression and allow 2 digits after that 6:
Should be what you are looking for