in reply to Regex not greedy enough

@records = split /(^ {3}\w.*\n)/m, $input;
should give you:
"", " record1blah\n", " dataforrecord1\n moredataforrecord1\n", " record2blah\n", " dataforrecord2\n moredataforrecord2\n", ...
You'll need to toss that first empty element... it's the part of the string leading up to your first record.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Regex not greedy enough
by snax (Hermit) on Nov 17, 2000 at 19:11 UTC
    Now that is handy! I didn't know you could capture the split regex stuff that way.

    Thanks!