Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.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
查看Regex后面的更新mariaDB列_Regex_Mariadb - Fatal编程技术网

查看Regex后面的更新mariaDB列

查看Regex后面的更新mariaDB列,regex,mariadb,Regex,Mariadb,我试图在regex后面写一个look,从MariaDB列中选择字符串 这是“我的表”列中的一个值。我正在编写一个正则表达式,它可以在href中使用firstProductLink获取锚定标记,并将其替换为空,如下所示 考虑使用MariaDB方法REGEXP\u替换列regex 我试过的正则表达式->?但这是行不通的 有人能帮我为上面的内容编写正则表达式吗?您不需要查找,因为这个词包含在您想要匹配和替换的内容中 REGEXP_REPLACE(columnname, '<span> *

我试图在regex后面写一个look,从MariaDB列中选择字符串

这是“我的表”列中的一个值。我正在编写一个正则表达式,它可以在href中使用firstProductLink获取锚定标记,并将其替换为空,如下所示

考虑使用MariaDB方法REGEXP\u替换列regex

我试过的正则表达式->?但这是行不通的


有人能帮我为上面的内容编写正则表达式吗?

您不需要查找,因为这个词包含在您想要匹配和替换的内容中

REGEXP_REPLACE(columnname, '<span>
 *<a.*firstProductLink.*
 *</a>
 *</span>', '')

您使用的是哪个版本的MariaDB?PCRE支持是在10.0.5中添加的。为什么需要对此进行回顾?你想在匹配中包含firsinsuranceLink。我删除了$character,它在regexp中有特殊意义。你需要在regexp中换行:另外,regex101要求你转义/characters,但在MySQL中不需要。它工作得很好。我今天学了正则表达式,希望将来能帮助别人。