搜索URL模式并使用REGEX在MySql上替换它
我正在尝试搜索所有以搜索URL模式并使用REGEX在MySql上替换它,mysql,regex,Mysql,Regex,我正在尝试搜索所有以https://institute-of-coaching.com/......./?id=...&utm_源=…&;utm_活动=…&;utm_medium=..来自一系列数据表,这些数据表在HTML标记下包含此模式 <a href=""institute-of-coaching.com/sf-webinar-sfw-5d-bha-dg/?id=sjn7962lmk&utm_source=Coaching-Skills-Articl
https://institute-of-coaching.com/......./?id=...&utm_源=…&;utm_活动=…&;utm_medium=..
来自一系列数据表,这些数据表在HTML标记下包含此模式
<a href=""institute-of-coaching.com/sf-webinar-sfw-5d-bha-dg/?id=sjn7962lmk&utm_source=Coaching-Skills-Article-Banner&utm_medium=Coaching-Skills-Article&utm_campaign=Coaching-Skills-Blog"" target=""_blank"" rel=""noopener noreferrer""><img class=""aligncenter"" src=""....../banner-3.png"" alt=""coaching skills 17"" width=""618"" height=""234""></a>"
谁能帮我调试一下,实现我的目标,用没有UTM参数的URL搜索并替换URL 什么版本的MySQL?使用
REPLACE_REGEXP()
需要8.x。在REGEXP中不需要转义正斜杠。为什么在所有HTML属性周围有两个双引号?在REGEXP中需要转义?
。由于我使用的软件,我在所有HTML参数周围有两个块引号。我承认这一点,但仍然没有得到适当的结果:从CHU的帖子中选择*,帖子内容类似于“(institute of coaching\.com/sf-webinar-sfw-5d-bha-dg/\?)\w*(=)。([A-Za-z0-9])\w*([&][A-z])。(目标=);
select *
from ch_posts
where post_content RLIKE '(institute-of-coaching\.com\/sf-webinar-sfw-5d-bha-dg\/?)\w*(=).([A-Za-z0-9])\w*([&][a-z]).*(target=)';