Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Removing javascript comments

by tachyon-II (Chaplain)
on Apr 10, 2008 at 03:53 UTC ( #679390=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $str =~ s/http:\/\///g;
    
    ...
    $str =~ s|http://||g;
    $str =~ s#http://##g;
    $str =~ s!http://!!g;
    
  2. or download this
    $str =~ s!(/\*[^/]+\*/)!>>>> \1 <<<<!g;  # /* comments */
    $str =~ s!(\s//[^/\n]+)!>>>> \1 <<<<!g;  # // comments
    print $str;
    
  3. or download this
    $str =~ s!(fancy re here)! print "$1\n"; "" !ge;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://679390]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-06-30 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (97 votes). Check out past polls.

    Notices?