Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
搜索URL模式并使用REGEX在MySql上替换它_Mysql_Regex - Fatal编程技术网

搜索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&amp;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&amp;utm_source=Coaching-Skills-Article-Banner&amp;utm_medium=Coaching-Skills-Article&amp;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=)';