I have some text in a field that I need to replace, but the issue is it has a number ID appended to it, which I need to remove and replace with my value in my MySQL Trigger.
My field is like this:
[["Randomthinghere","anotherranodm4234","pitahayas","apples","bananas","apricots","grapes","kiwifruit"],["ACRE_PRC119_ID_9","randomthing","randomthing2"]]
And the value I need to replace ACRE_PRC119_ID_9 with is ACRE_PRC119, however its not always ID_9, it can be any reasonably small number value.
I’ve searched all over and read through manuals, and I’m honestly not sure what solution there is, if any in MySQL because I can’t apply wildcard to replace.
If any solution requires REGEXP I could do something like REGEXP ^.*[[.".]]ACRE[[._.]]PRC119[[._.]]ID[[._.]]{[0-9]{1,9}}.*$'; sadly you can’t capture the result.
Here you go