In your regular expression .
It is processed literally, and not as a metacharacter to match any character except a new line.
Try:
<pre>(.|\n)*?</pre>
Since no OS is specified, a new line can be represented either \n
(Unixes) or \r\n
(windows). In any case, you can use:
<pre>(.|\r?\n)*?</pre>
source share