I'd really appreciate anybodies help right now, I'm at my wit's end. I'm building a function to minify javascript, and I'm getting caught on a regex that matches js regexes. What I've come up with so far is
Code: Select all
if (preg_match("|(/.*?(?<!\\\\)/)|",$data, $var2, PREG_OFFSET_CAPTURE, $x)){
$out .= $var2[0][0];//Add match to the output //
$x += (strlen($var2[0][0]))-1;//Advance x
}Code: Select all
"|(/.*?(?<![^\\\\]\\\\)/)|"Thanks in Advance,
Paul.