$string =~ /$start(.+?)$end/s;
The case insensitivity isn't needed in this case, but slurping everything up as one line is.
Then the match is stored in $1.
You don't need the quotemeta in this case (as Yves points out below), but I guess it's good practice to get into until you know *all* regex meta characters.
cLive ;-)
In reply to (cLive ;-) Re: pattern matching
by cLive ;-)
in thread pattern matching
by silent11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |