Maison > Article > développement back-end > 坑爹的正则,请问
坑爹的正则,请教
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>'