gpt4 book ai didi

html - MySQL正则表达式查找结尾带有空格的href

转载 作者:行者123 更新时间:2023-11-29 12:43:05 26 4
gpt4 key购买 nike

MySQL 表中有一个列存储 HTML 代码。

不幸的是,一些链接href以空格结尾,例如

...some code...<a href="/path/further-path/and-more-path "...>some-text</a>...some code...

现在我必须找到在其内容列中具有此类链接的每个列行。

尝试了一些正则表达式选择:

content REGEXP '.+href="[a-zA-Z0-9/\-][[:space:]]".+'
content REGEXP '.+href="[a-zA-Z0-9/\-]( )".+'

无论有没有 .+,但他们都找不到合适的东西。我确信有包含此类链接的条目;)。

请帮忙。我根本不是正则表达式专家。

最佳答案

您缺少 + 量词:

content REGEXP '.+href="[a-zA-Z0-9/\-]+[[:space:]]".+'
# here __^

关于html - MySQL正则表达式查找结尾带有空格的href,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25844888/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com