SQL Functions LOWER() and UPPER() have no effect on the result returned by PREG_REPLACE(). See the result of this: SELECT lower(preg_replace('/(Editura) ?/','','Editura Corint')) as _start_nume, lower('Editura Corint') as _nume