我有一个字符串:
<li><a href="http://www.site.tv/watch/some-text-english-subbed-dubbed-online/" title="title">title</a></li><div class="clear"></div></ul><h3><a name="dot">.dot</a></h3><ul><li><a href="http://www.site.tv/watch/searched-too-some-words-english-subbed-dubbed-online/" title="title2">title22</a></li>
我想用 preg_match_all 找到“some-text”和“searched-too-some-words”。但它不适用于这个
preg_match_all('/http\:\/\/www\.site\.tv\/watch\/([^-]*)-english[^\/]*/s', $var, $result, PREG_PATTERN_ORDER);
$result 什么都不是
或者
preg_match_all('/http\:\/\/www\.site\.tv\/watch\/(.*)-english[^\/]*/s', $var, $result, PREG_PATTERN_ORDER);
$result will be: http://www.site.tv/watch/some-text-english-subbed-dubbed-online/" title="title">title</a></li><div class="clear"></div></ul><h3><a name="dot">.dot</a></h3><ul><li><a href="http://www.site.tv/watch/searched-too-some-words-english-subbed-dubbed-online
有没有办法在“http://www.site.tv/watch/”之后找到这个词,直到“-english”
问候基督徒