PHP中的正则表达式忽略
例如,有一行:PHP中的正则表达式忽略,php,regex,preg-match,Php,Regex,Preg Match,例如,有一行: <a title="best title in the world" href="http://website.com/15661-erko-rhyno/">! Erko_Rhyno !</a> 即时通讯使用: (?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\
<a title="best title in the world" href="http://website.com/15661-erko-rhyno/">! Erko_Rhyno !</a>
即时通讯使用:
(?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\/).*?(?=\<\/a\>\<\/strong\>)
我知道它为什么返回15661 erko rhyno/“>
,因为我指定只忽略这一部分:
<strong><a title="best title in the world" href="http://www.webste.com/web/index.php/user/
15661-erko-rhyno/">`
总是在变化,我不知道如何忽略这一部分,我将重复我自己,并将再次提供我起诉的代码,以忽略我不需要的字符::
(?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\/).*?(?=\<\/a\>\<\/strong\>)
(?只需忽略>字符,如
\>([^\>]+)\<\/a\>
\>([^\>]+)\
要获得!Erko_Rhyno!
在第(1)组中将在9分钟内选择这是一个答案,现在不让我感谢!。
(?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\/).*?(?=\<\/a\>\<\/strong\>)
\>([^\>]+)\<\/a\>