Use LIKE instead of REGEXP when possible

The use of LIKE instead of REGEXP makes the query take advantage of the DB indices on the fields when available.
There are still some edges cases when it is not possible to use LIKE (damn MySQL!) and, in such cases, the REGEXP fallback is used.