If I understand you correctly, the problem is that (by default) -p and -n cause the file(s) to be processed line-by-line. Therefore your regex is being applied line-by-line and can never match a pattern that stretches across more than one line as it never sees more than one line at any one time. Phew! What a mouthful:)
To work around this problem, you would need to cause the file to be processed as a single long line using 'slurp mode'. Try adding -0777 to your command line. See perlrun for details.
In reply to Re: 'one-liner' help
by BrowserUk
in thread 'one-liner' help
by buc99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |