php - Regular Expression first 2 characters either alphabetic or numeric but not combination of both -
i need regular expression in php validate string like: "ab345678" or "12345678". is, eight(8) letter string containing first 2 letters alphabetic or numeric, not combination of both, , remaining 6 letters numeric. tried own it's not working.
here code:
/^[0-9a-za-z]{2}[0-9]{6}$/
i'm new regex hence need here.
thanks in advance.
you can this
^([a-za-z]{2}|\d{2})\d{6}$
Comments
Post a Comment