$text =~ s/( (?:(?:[^\/][^\/]*?|)*? # anything, except comment sym +bol ("|').*?\2 # quoted string (and take ever +ything) (?:[^\/][^\/]*?|)*? # anything, except comment sym +bol )*? ) (?: \/\/ # comment symbol [^\\]* # anything, except continuatio +n )??$ /$1/x; print $text, "\n";
In reply to Removing '//' comments by Yunus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |