in reply to Re: String Newline Question
in thread String Newline Question

$ behaves like (?=\z|\n)
No, it behaves like (?=\n?\z). Yours would match any embedded newline.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: Re: String Newline Question
by Juerd (Abbot) on Mar 23, 2002 at 22:30 UTC

    No, it behaves like (?=\n?\z). Yours would match any embedded newline.

    Oops, I was describing the situation for when /m (or (?m:)) is in effect, which was not the case.

    Update - Hm, even if that were the case, it would be wrong. It would behave like (?=\n\z?|\z).

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk