MySql REGEXP operator

mysql, operators, regex

Solution

Use the `BINARY` keyword, which forces `REGEXP` to match the string as a binary string, which is done case-sensitively.

SELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';

Although this isn't explicitly stated in the docs (that you can do it with a regular string), in my experience it works as expected.

Problem

The mySql REGEXP operator is not case sensitive. Is there a version of this operator that is case sensitive?

Original source