This is what my professor is asking of us; Write a PHP regular expression pattern that matches a string that satisfies the following description:
- The string must begin with the (uppercase) letter A.
- Any three alphanumeric characters must follow.
- After these, the letter B (uppercase of lowercase) must be repeated one or more times.
- The string must end with two digits.
Regex:
^A[[:alnum:]]{3}[Bb]+[[:digit:]]{2}$
I found this other version online, however it doesn't technically start with the letter A. I guess technically neither did mine...
[[:< : ]](A[[:alpha:]]{3}+[bB]+[a-zA-Z0-9]+[[:digit:]]{2})[[:>:]]