开发者

Need SQL-Regexp help: Find lowercase char before uppercase char

开发者 https://www.devze.com 2023-02-19 01:52 出处:网络
I need a mySQL request where I only find strings which contains a uppercase character before a lowercase char within a single word.

I need a mySQL request where I only find strings which contains a uppercase character before a lowercase char within a single word.

Example: fooExample

In best case only if there are at least 2 characters before the uppercase char. So it should not find: "iPhone" for example. And it must be a real char in range from a-z before A-Z.

I guess I should use the SQL function REGEXP, but I can't get it working because I'm开发者_StackOverflow社区 not very familiar with regular expression.


SELECT col
FROM tableName
WHERE col REGEXP '[a-z]{2}[A-Z]'


select * from table where binary(your_field) regexp '^[a-z]{2,}[A-Z]+'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号