首頁  >  文章  >  後端開發  >  坑爹的正则,请问

坑爹的正则,请问

WBOY
WBOY原創
2016-06-13 12:40:21987瀏覽

坑爹的正则,请教

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>'

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn