in reply to strip JS-comments

Not trying to be picky but:

var bar = "Use \"//\" to make single-line comments" window.alert(bar)


antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

Replies are listed 'Best First'.
Re: Re: strip JS-comments
by Skeeve (Parson) on Jun 11, 2003 at 05:43 UTC
    Ooops!

    You are absolutely right. So how can I update my code above, except from stating here:

    Update (thanks to antirice):

    my $qs =qr/'(?:[^\\']|\\.)*'/; my $qqs=qr/"(?:[^\\"]|\\.)*"/;