Skip to content
Advertisement

How to regex in a MySQL query

I have a simple task where I need to search a record starting with string characters and a single digit after them. What I’m trying is this

And

But both of the queries always return a null record

Where as if I execute the following query

it returns

It means that I have records that starts with ALA and a digit after it,

EDIT

I’m doing it using PHP MySQL and innodb engine to be specific.

Advertisement

Answer

I think you can use REGEXP instead of LIKE

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement