Home  >  Article  >  Backend Development  >  提取网址参数的正则表达式

提取网址参数的正则表达式

WBOY
WBOYOriginal
2016-06-13 12:10:111179browse

求一个提取网址参数的正则表达式

<a href='/(kwd0vo45lmdsk055xcz3ov55)/default2.aspx'>here</a>

这部分当中的kwd0vo45lmdsk055xcz3ov55这个提取出来
我用
preg_match_all('/<a\s+href=["|\']?([^>"\' ]+)["|\']?\s*[^>]*>([^>]+)<\/a>/i',$result,$match);<br />

不行啊
谢谢大家了
------解决思路----------------------
preg_match_all("/\((.+?)\)/i",$str, $result);<br />echo $result[1];

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn