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
Mysql 在前面没有空格的字符串中查找http://_Mysql_Regex - Fatal编程技术网

Mysql 在前面没有空格的字符串中查找http://

Mysql 在前面没有空格的字符串中查找http://,mysql,regex,Mysql,Regex,我正在寻找一个用于MySQL的正则表达式,它将找到一行,其中包含以下内容: 将匹配: 这是text http://并且在http之前没有空格 不匹配: 这是文本http://但是有一个空格,所以很高兴 我尝试了WHERE message REGEXP'[\s]http:',出于某种原因,这找到了一些,但我知道不是所有的实例。谢谢在http://之前匹配包含“非空格”字符的字符串: regexp '[^[:space:]]http://'; 看 @TimBiegeleisen为什么不呢(参见示

我正在寻找一个用于MySQL的正则表达式,它将找到一行,其中包含以下内容:

将匹配:
这是text http://并且在http之前没有空格

不匹配:
这是文本http://但是有一个空格,所以很高兴


我尝试了
WHERE message REGEXP'[\s]http:'
,出于某种原因,这找到了一些,但我知道不是所有的实例。谢谢

http://
之前匹配包含“非空格”字符的字符串:

regexp '[^[:space:]]http://';


@TimBiegeleisen为什么不呢(参见示例)?@TimBiegeleisen这也符合预期,并且工作正常。你明白这个问题了吗?他显然是想在某个专栏中找到断开的链接。@ʰᵈ真不错!谢谢很抱歉回复的太晚,但谢谢你们的帮助和问题的解决!
mysql> select * from test;
+------------------+
| s                |
+------------------+
| texthttp://text  |
| http://text      |
| text http://text |
| texthttp://      |
| text http://     |
+------------------+
5 rows in set (0.00 sec)

mysql> select * from test where s regexp '[^[:space:]]http://';
+-----------------+
| s               |
+-----------------+
| texthttp://text |
| texthttp://     |
+-----------------+
2 rows in set (0.00 sec)