in reply to Regex not greedy enough
should give you:@records = split /(^ {3}\w.*\n)/m, $input;
You'll need to toss that first empty element... it's the part of the string leading up to your first record."", " record1blah\n", " dataforrecord1\n moredataforrecord1\n", " record2blah\n", " dataforrecord2\n moredataforrecord2\n", ...
-- 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 |