这里是我想匹配的模式:PHP,preg_match,正则表达式。我究竟做错了什么?
<div class="class">
<a href="http://www.example.com/something"> I want to be able to capture this text</a>
<span class="ptBrand">
这是我在做什么:
$pattern='{<div class="productTitle">[\n]<((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)>([^\n]*)</a>[\n]<span class="ptBrand">}';
preg_match($pattern, $data, $matches,PREG_OFFSET_CAPTURE);
print_r($matches);
它打印:
阵列()
是不是划定它。 – manny 2009-11-13 00:58:40