I want a regex for PHP that can match two alphabetic characters or two numeric characters. For example:
AB or 45
The characters can't be mixed with alphabetic and numeric.
^(\w)\1|[A-Z|0-9]{2}$
I used the above regex but it doesn't work correctly.