本文介绍了MySql REGEXP运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
mySql REGEXP运算符不区分大小写.此操作符的版本是否 区分大小写?
The mySql REGEXP operator is not case sensitive. Is there a version of this operator that is case sensitive?
推荐答案
使用BINARY
关键字,该关键字强制REGEXP
将字符串作为二进制字符串进行匹配,区分大小写.
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.
这篇关于MySql REGEXP运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!