save yourself a while and a join.open(IN,"somefile.pl"); undef $/; $string = <IN>;
This covered all the 'normal' ways of printing a line that I could think of. I you run across any more, I'll update the expression.$string = q{ print "Content-type:text/html\n\n"; print "Some big hunk of code\n"; print("Content-type:text/html","\n","\n"); print ('Content-type: text/html',"\n","\n"); print "Yet another big hunk of code\n"; print "Yet more big hunks of code\n"; print ("Content-type: text/html"); print 'Content-type: text/html',"\n +\n"; print "Some other big hunk of code that does something really cool\n"; print ("Content-type: text/html"); print 'CONTENT-type: text/html' , " +\n", "\n"; print "Some code that ends the program\n"; }; print $string,"\n"; $string =~ s/print[\s'"\(]+content-type:\s*text\/html[\\nr\s'"\),]+;// +gi; print "---------------\n"; print $string,"\n";
In reply to Re: A Reg Exp Question
by maverick
in thread A Reg Exp Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |