如何用正则表达式匹配到PHP多行注释?

/************123****************/如何用正则表达式匹配出来?
2025-05-01 04:17:18
推荐回答(3个)
回答1:

$str = '
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/';
preg_match_all('|/\*.*?\*/|is', $str, $matches);
print_r($matches);

exit;

回答2:

/\/[*]{2,}[^*]+[*]{2,}\//g;

回答3:

正则
/\/\*[\s\S]\*\//U