minify
minify copied to clipboard
Regex gets stripped as comment in JS.php
I am trying to minify some javascript that contains
test: [/\sedg\//i],
which is not extracted as a string and seems to be matched by the single-line comments pattern in JS.php and gets truncated after //:
// single-line comments
$this->registerPattern('/\/\/.*$/m', '');
My try was to have the regex positively look behind for the beginning of the line or anything but a backslash:
$this->registerPattern('/(?<=^|[^\\])\/\/.*$/m', '');
But that did not match comments exactly at the beginning of the file.
How could that minification work?
Thanks a lot!
Referencing #323