Home  >  Article  >  Backend Development  >  坑爹的正则,请问

坑爹的正则,请问

WBOY
WBOYOriginal
2016-06-13 12:40:21954browse

坑爹的正则,请教

config.php<br />
<br />
$_LANG['new_arrival']       = 'New Arrivals';<br />
$_LANG['hot_products']   = 'Hot Products';<br />
$_LANG['group_deals']     = 'Group Deals';<br />
$_LANG['specials']            = "Specials";<br />
$_LANG['after']            = '<div>Contact cu\'stomer</div> <br />
<table><tr><td>service for</td></tr> <br />
<tr><td>order status and</td></tr>  <br />
<tr><td>other after-sales issues</td></tr></table>'; <br />
$_LANG['group_deals']     = 'Group Deals'; <br />
<br />
$subject = file_get_contents("config.php");<br />
$pattern = '这里正则要如何写呢'; <br />
preg_match_all($pattern, $subject, $matches); <br />
print_r($matches);<br />
<br />
我要取出等号后面的所有内容,正则要怎样写呢? <br />
请注意等号后面字符串中的符号(单引号,双引号,转义符己及换行都要取到)。<br />
<br />
结果如下:<br />
1. 'New Arrivals' <br />
2. 'Hot Products' <br />
3. 'Group Deals'<br />
4. "Specials"<br />
5.  '<div>Contact cu\'stomer</div> <br />
<table><tr><td>service for</td></tr> <br />
<tr><td>order status and</td></tr> <br />
<tr><td>other after-sales issues</td></tr></table>'

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