Unfortunately you can’t. REGEXP
uses the byte of the character, its code, which differentiates accented and not accented characters, since each one has a different code.
I already had this problem, and I found this response from the OS in English: Mysql REGEXP query - Accent insensitive search
, and there he quotes a link from the documentation of MySQL
: Mysql REGEXP, that has this text:
Warning The REGEXP and RLIKE Operators work in byte-Wise fashion, so they are not multibyte safe and may Produce Unexpected Results with
multibyte Character sets. In addition, These Operators compare
characters by their byte values and accented characters may not
compare the Equal Even if a Given collation Treats them as Equal.
In free translation:
REGEXP and RLIKE operators work "byte way", so no
are safe for multibytes and can produce unexpected results
with multibyte character sets. In addition, these operators
compare characters by their byte values and accented characters
cannot be compared as equal*("and" is not equal to "is" for example)*, even if a given
group treat them as equal.
Apparently it worked, I put a function in php to replace accents with regular expression Rules, Function replacerAcentos($string){ Return preg_replace(array("/(á|à|ã|â|à|","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/","/(í|ì|î|ï)/","/(Í|Ì|Î|Ï)/","(ó|ò|õ|ô|ö)/","/(Ó|Ò|Õ|Ô|Ö)/","/(ú|ù|û|ü)/","/(Ú|Ù|Û|Ü)/","/(ñ)/","/(Ñ)/"), 
 explode(" ","(á|à|ã|â|ä) (Á|À|Ã|Â|Ä) (é|è|ê|ë) (É|È|Ê|Ë) (í|ì|î|ï) (Í|Ì|Î|Ï) (ó|ò|õ|ô|ö) (Ó|Ò|Õ|Ô|Ö) (ú|ù|û|ü) (Ú|Ù|Û|Ü) (ñ) (Ñ)"), $string);
}
– Gabriel
yes, if replace or include all variations to compare it will work
– Ricardo Pontual