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

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

WBOY
Release: 2016-06-13 12:10:11
Original
1192 people have browsed it

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template