REGEXP_REPLACE in post_contet
So, basically, I want to remove trailing slashes from specific domain urls. For example: https://www.example.com/here/postname/
into https://www.example.com/here/postname
I have 10.4.21-MariaDB which should support REGEXP_REPLACE function.
This is my query:
UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, '(http\S+)\/(\s|$)', '$1');
or this one more specifically:
UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, '(https:\/\/www\.example\.com\/here\/\S+)\/(\s|$)', '$1');
which according to regular expressions should work: https://regex101.com/r/slLbgg/1
What am I doing wrong?
Any kind of help is appreciated! :)
Topic post-content regex Wordpress sql
Category Web