I have a table in MySQL 8. In a varchar column, I want to replace long substrings by another substrings. I can find those rows using this regex:
SELECT notetext FROM mytable WHERE notetext REGEXP '[a-zA-Z0-9_.:/-]{45,}';
This Regex searches for all rows that has substrings with length>45. However, I cannot figure out how to replace the matched substrings by a replacement substring. I want to do something like this:
update mytable set notetext = replace(notetext,** regex match ***, 'replacement text') WHERE notetext REGEXP '[a-zA-Z0-9_.:/-]{45,}';