Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2022-01-28 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (72 votes). Check out past polls.

    Notices?