I\'m trying to replace a bunch of characters in a MySQL field. I know the REPLACE function but that only replaces one string at a time. I can\'t see any appropriate function
I've been using lib_mysqludf_preg for this which allows you to:
Use PCRE regular expressions directly in MySQL
With this library installed you could do something like this:
SELECT preg_replace('/(\\.|com|www)/','','www.example.com');
Which would give you:
example