Make your dot-stars non-greedy, and use the 'm' modifier:
$_=" Blah junk .PP blah more stuff .PP boo razz "; print $1 if /^(\.PP.*?\n.*?\n\.PP)/m; #prints .PP blah more stuff .PP
In reply to Re: match across specified # of lines
by hbm
in thread match across specified # of lines
by bill b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |