ユーザー入力のリンク構造:
++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.
私の目的:
====
との間の部分++
に 1 つ以上のスペース文字が含まれている場合、preg_match_all
一致しないはずです。したがって、私の望ましい出力は、最初の 2 つのリンク試行と一致することです。w ww
ただし、 1 つの空白文字が含まれているため、最後のリンク試行は一致しないはずです。
私の失敗した試み:
\+\+(.+?)====(.+?[^ ])\+\+
\+\+(.+?)====(.+?[^ {1, }])\+\+
訂正していただけますか?