MySQL Case-insensitive Regex Match Aug 23rd 2021 Words: 56

The following MySQL query:

1
SELECT * FROM user WHERE name REGEXP '.*Noir';

It matches user name ‘Foo Noir’ and ‘Noir Bar’, but not ‘noir’.

To use case-insensitive match, use REGEXP_LIKE and add i flag:

1
SELECT * FROM user WHERE REGEXP_LIKE(name, '.*Noir', 'i');

Reference: