$re = '/(.*)\/\/(.*)/m';
$str = ' id: string;
avatar: string;
name: string; // 名称
brief: string; // 简介
type: string; // ip 形象类型 image:图片类型|figure2d:2d数字人
dubbingId: string; // 默认配音
percent: string; // 比例
previewUseVideo: {
// 预览使用视频
url: string; // 地址
};
coverUrl: string; // 封面url
videoUrl: string;
duration: number; // 时长(s)';
$subst = " /** $2 */ \n $1";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php