Reputation: 111
I am trying to match sql pattern with like: LIKE '%\"email\";s:[1-9]:%'
The string in the database is like this: "email";s:15:
But is not working to see if between s:[1-9]: are any numbers greater than 1 or if there are any numbers.
Any help appreciated
Upvotes: 1
Views: 1904
Reputation: 49260
Use a regex match.
where col_name regexp '"email";s:[2-9]:|"email";s:[1-9][0-9]+:'
Upvotes: 1
Reputation: 562358
The LIKE
comparison operator does not recognize regular expression syntax. It only recognizes wildcards _
and %
.
You need to use RLIKE
or REGEXP
(they're actually synonyms).
You can read about them here: https://dev.mysql.com/doc/refman/5.7/en/regexp.html
Upvotes: 1