Home > Backend Development > PHP Tutorial > PHP怎么用正则表达式匹配圆括号

PHP怎么用正则表达式匹配圆括号

WBOY
Release: 2016-06-13 13:47:04
Original
1259 people have browsed it

PHP如何用正则表达式匹配圆括号
我在做CURL数据采集,要获取

............

之间的内容,

我使用正则表达式来获取。

正则表达式我写成

(.*)



(.*)



都不行。应该如何写呢?

------解决方案--------------------
试试,没有问题

如果匹配多行,正则/……/s s来修饰
PHP code

$html    =<p class="jianju">............</p><div></div>之间的内容,
DOC;

preg_match('/<span><p>(.*)</p>
<div>/', $html, $m);
print_r($m[1]); <div class="clear">
                 
              
              
        
            </div>
</div></span>
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