Suppose I have a purely alphanumeric string (“abc123”), and I want to see if it’s in a database column, with one caveat– I want all nonalphanumeric characters to be ignored in the comparison. So “abc~!@#$%^&*()123” would match, for example.
Is there a simple way to do this in MySQL, preferably without defining any functions? I was thinking it might be possible with REGEXP comparison.
Figured it out with this regular expression..
Then I do
The_Column REGEXP $regexp