我试图让这个正则表达式工作有困难.我要做的就是删除块注释.这是我到目前为止,但我不能摆脱决赛*/.
$string = 'this is a test /*asdfa */ ok then';
$pattern = '/\/\*([^\*\/]*)/i';
$replacement = '';
echo preg_replace($pattern, $replacement, $string);
//this is a test */ ok then
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
| 归档时间: |
|
| 查看次数: |
2245 次 |
| 最近记录: |