in reply to A Reg Exp Question
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE:(2) A Reg Exp Question
by swiftone (Curate) on Jun 28, 2000 at 19:49 UTC | |
by maverick (Curate) on Jun 28, 2000 at 21:14 UTC |