Regexp routines for mysql, implemented without UDF