in reply to 'one-liner' help

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.


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Replies are listed 'Best First'.
Re: Re: 'one-liner' help
by buc99 (Initiate) on Apr 16, 2003 at 23:01 UTC
    Nope. Does not seem to work.

    would not the /s in the /sgi cause it to read multilines?

    Thanks.
    SA
    :)
      would not the /s in the /sgi cause it to read multilines?

      No. They modify how the regex behaves, but the regex has nothing to do with how input is handled. If input is a line-at-at-time, /s won't help you.