我在尝试使用这个正则表达式时遇到了困难。我只是想删除块注释。目前为止,我已经做到了这一点,但是我无法去掉最后的*/
。
$string = 'this is a test /*asdfa */ ok then';
$pattern = '/\/\*([^\*\/]*)/i';
$replacement = '';
echo preg_replace($pattern, $replacement, $string);
//this is a test */ ok then
任何帮助都会受到欢迎。