Help for this page

Select Code to Download


  1. or download this
    #I want to remove this line.
    #"#This line too"
    ...
    puts "############I don't want to remove this content bcoz it is in qu
    +otes#"  #But remove this content.
    puts "This is for testing ##sdfsfsf"  ###Remove this content.
    puts 'This is for testing ##testing' #I want to remove this content al
    +one'
    
  2. or download this
    I have tried the following expression,
    
    ...
         $_ =~ s/([^"|'](#)+.*[^"|'])\s*#.*$/$1/;
         $_ =~ s/[^"|']#.*[^"|']$//;
    
  3. or download this
    Desired output:
    puts "Hello, Ruby!" ",,,,,....'''"
    puts "############I don't want to remove this content bcoz it is in qu
    +otes#"
    puts "This is for testing ##sdfsfsf"
    puts 'This is for testing ##testing'