in reply to Compressing/obfuscating Javascript
Either way, can someone help me regarding the regex for the removal of comments without removing urls?
See How to ask better questions using Test::More and sample data
use strict; use warnings; use Test::More; my @cases = ( { in => 'http://etc...', out => 'http://etc...' }, { in => 'foo//bar', out => 'foo' }, ); plan tests => scalar @cases; for my $t (@cases) { my $have = $t->{in}; $have =~ s#(?<!http:)//.*$##; is $have, $t->{out}, "$t->{in} correctly processed"; }
🦛
|
|---|