How can I do a search for the last name of a people but with a regular expression?
Today I use SUBSTRING_INDEX
to get the last name , but I want to get parts of this last name when I search by name or fragments of people I am using REGEXP that calls a function of mine that creates a regular expression.
When I try to use SUBSTRING_INDEX
with REGEXP
it will not stop right.
I use cakePHP to develop.
The command line below:
$filtros = array_merge($filtros, array("SUBSTRING_INDEX(Usuario.nome, ' ', 1) = 'REGEXP \"".$this->stringParaBusca($criterios["criteriaPrimeiroNome"])."\"'"));