It's not clear to me what you are trying to achieve, but maybe the following will point you in the right direction:
use strict; use warnings; while (<DATA>) { next if ! (/Line above/ .. /Line below/); next if ! /Description\s+"([^"]*)"/; print "Found $1 in line $.\n"; } __DATA__ Line above Description "xyz" Line below Line above Line below
Prints:
Found xyz in line 2
In reply to Re: regex problem
by GrandFather
in thread regex problem
by Otogi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |