in reply to Re^3: Extract Multiple Lines from the End of a multi-line string
in thread Extract Multiple Lines from the End of a multi-line string

Thanks for the explanation. I was trying to do something like (.*\n){5} and was getting nowhere.

Replies are listed 'Best First'.
Re^5: Extract Multiple Lines from the End of a multi-line string
by ikegami (Patriarch) on Oct 17, 2008 at 16:58 UTC
    Presumably followed by \z? Your last line doesn't end with \n, and that's a bad use of capturing parens.
      Yes it was followed by /z. Why is that bad use of capturing parens?

        What do you think /(...){5}/ captures? The parens are there for grouping, not capturing. If you wanted to capture the five things, you'd use /((?:...){5})/

        Note: New features in Perl 5.10 may make /(...){5}/ useful