samedi 18 avril 2015

Regular Expression remove Javascript String Continuation

I have some javascript that isn't compiling in Google Closure because it has string continuation in it. I've tried to remove the slash and new line character with regular expressions but I can't get it to find between the talking marks.


Here is an example of the javascript:



var test = '<div class="pp_pic_holder"> \
<div class="ppt">&nbsp;</div> \
</div>';


and this is what I have so far:



preg_replace("/\\r?\n|\r/", "", $input_lines);

Aucun commentaire:

Enregistrer un commentaire