You can use REGXP_REPLACE for this.
https://mariadb.com/kb/en/regexp_replace/
First test it. this will give you two columns side by side to preview changes. :To run it:The match is also placeholder:That' very simplistic example and regex can be mind numbing trying to read. Matching
https://mariadb.com/kb/en/regexp_replace/
First test it. this will give you two columns side by side to preview changes. :
Code:
SELECT post_text, REGEXP_REPLACE(post_text,' I love my (cat|dog) ',' I love my horse ') AS new_match FROM phpbb_posts WHERE post_text REGEXP ' I love my (cat|dog) ';
Code:
UPDATE phpbb_posts SET post_text_column = REGEXP_REPLACE (post_text, ' I love my (cat|dog) ',' I love my horse ');
Code:
UPDATE phpbb_posts SET post_text_column = REGEXP_REPLACE (post_text, ' I love my (cat|dog) ', # \\1 will either be cat or dog. ' I hate my \\1. ' );
some.random.name@example.com
is even more difficult because it's enclosed in formatting for the bbcode. I've found chatGTP quite helpful for creating regex but you need to be precise in what you are asking.Statistics: Posted by thecoalman — Fri Sep 27, 2024 6:14 pm