The table "article" has a cloumn named "A_Title". I want to select the A_Title that matches exactly both /[A-Za-z]+/ and /[\x{0981}-\x{09E3}]/u regex at the same time.
I tried several methods for it, but neither is working. Giving error: #1139 - Got error 'invalid character range' from regexp
SELECT A_Title FROM article WHERE A_Title REGEXP '[A-Za-z]+.*[\x{0981}-\x{09E3}]|[\x{0981}-\x{09E3}].*[A-Za-z]+'
SELECT A_Title FROM article WHERE A_Title REGEXP '[A-Za-z]+.*[\\x{0981}-\\x{09E3}]|[\\x{0981}-\\x{09E3}].*[A-Za-z]+'
Below code works, but it is not using the same regex:
SELECT A_Title FROM article WHERE A_Title RLIKE '[A-Za-z]+.*[ঀ-৳]|[ঀ-৳].*[A-Za-z]+'
For MySQL regex;
\x{0981}this syntax is incorrect; So, just remove the x from it in your regexp.and then you can combine these both REGEXP statements the same way you have written your working regexp in the post :
As you have already tagged
RLIKEin your post; you can even use it instead ofREGEXPas REGEXP and RLIKE are synonyms for REGEXP_LIKE() synonym of REGEXP.