MySql REGEXP operator

后端 未结 1 1724
时光取名叫无心
时光取名叫无心 2021-01-14 07:39

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

相关标签:
1条回答
  • 2021-01-14 08:13

    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.

    0 讨论(0)
提交回复
热议问题