我的用户输入链接结构:
++visible part of link====invisible HTML address part of link++
输入字符串:
some text here some text here ++stack overflow====http://stackoverflow.com/questions/ask++ some text here ++examplesite.com====http://www.examplesite.com/article?id=1++ some text here some text here some text here some text here ++shouldnotmatch.com====http://w ww.shouldnotmatch.com/++ some text here.
我的目标:
如果 和 之间的部分====包含++一个或多个空格字符,preg_match_all则不应匹配。所以我想要的输出是与前两次链接尝试相匹配。但最后一次链接尝试不应匹配,因为w ww包含一个空格字符。
我不成功的尝试:
\+\+(.+?)====(.+?[^ ])\+\+\+\+(.+?)====(.+?[^ {1, }])\+\+
你能纠正我吗?