Mysql Function Regexp Replace Postgresql