# $text is the main text you want to process # $begin is the begin keyword # $end is the end keyword $text =~ s/\Q$begin\E.*\Q$end\E//s;
the '\Q' and '\E' around '$begin' and '$end' quote them so that even if they contain regexp characters, they won't do unexpected things. see the perlre manpage. of course, i'm sure someone will point out that dotstar is bad, but the question was pretty vague.
In reply to Re: script for removing certain text
by thraxil
in thread script for removing certain text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |