Regex yoluyla Blok Yorumlar Çıkarma

0 Cevap php

Ben zorluk bu regex işe almak için çalışıyorum yaşıyorum. Ben yapmaya çalışıyorum bütün blok yorumları kaldırmak olduğunu. Bu şimdiye kadar ama son */ kurtulmak olamaz budur.

$string = 'this is a test /*asdfa  */ ok then';

$pattern = '/\/\*([^\*\/]*)/i';

$replacement = '';

echo preg_replace($pattern, $replacement, $string);

//this is a test */ ok then

Herhangi bir yardım takdir edilecektir.

0 Cevap