I'm using a Perl program to extract text from a file. I have an array of strings which I use as delimiters for the text, e.g:

$pat = $arr[1] . '(.*?)' . $arr[2];

if ( $src =~ /$pat/ ) {
   print $1;
}

However, two of the strings in the array are $450 and (Buy now). The problem with these is that the symbols in the strings represent end-of-string and capture group in Perl regular expressions, so the text doesn't parse as I intend.

Is there a way around this?

Edit
Report