Help for this page
#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'
I have tried the following expression, ... $_ =~ s/([^"|'](#)+.*[^"|'])\s*#.*$/$1/; $_ =~ s/[^"|']#.*[^"|']$//;
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'