views:

20

answers:

1

Hi Guys,

I have some problem with REGEXP and MYSQL.

How I cant ignore the accent on my string to compare with the regexp value?

SELECT ('estágio') REGEXP '(estagio)') AS dados

I cant remove the accent from the database.

I tried to convert to _bin or utf8_unicode_ci , but with no sucess.

Somebody has a tip for do that?

tks !

+1  A: 

You can replace all the character that can have accent with something like this :

estagio -> [eèêéë]st[aàâäá]g[iìïîí][oôöòó]

All you need to do is a replace before your query so that "a" would become "[aàâäá]", "i" would become [iìïîí], etc.

This will form you a valid Regex that will accept accent on character.

HoLyVieR