Match beginning of words in Mysql for UTF8 strings

Posted by ankimal on Stack Overflow See other posts from Stack Overflow or by ankimal
Published on 2010-04-23T20:56:51Z Indexed on 2010/04/23 21:03 UTC
Read the original article Hit count: 367

Filed under:
|

Hi,

I m trying to match beignning of words in a mysql column that stores strings as varchar. Unfortunately, REGEXP does not seem to work for UTF-8 strings as mentioned here

So,

select * from names where name REGEXP '[[:<:]]Aandre';

does not work if I have name like Foobar Aándreas

However,

select * from names where name like '%andre%'

matches the row I need but does not guarantee beginning of words matches.

Is it better to do the like and filter it out on the application side ? Any other solutions?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about regex