urburp has asked for the wisdom of the Perl Monks concerning the following question:
Howdy
I've got file I want to split into chunks, but I'm not sure where the newlines and spaces lie, or how they are interwoven.
It's got the basic structure:
Title Line (\n?)
(4 spaces)Author Line (\n?)
(4 spaces)URL Line (\n?)
... Repeat
However there are things interwoven like header lines:
-----------------------------------------
BLAH Header
-----------------------------------------
Now my question ;) :
if I split the file using: s/\n/ms
I get a string of 0's and 1's
1111100001011001110111110011110011111001111001111100111011111110011111110011111100111011111001111100
I just *know* this is useful information, but how can I incorporate it into a (relatively) simple pattern match??
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding a pattern to split on
by kilinrax (Deacon) on Dec 05, 2000 at 01:00 UTC | |
by urburp (Initiate) on Dec 05, 2000 at 01:26 UTC | |
by kilinrax (Deacon) on Dec 05, 2000 at 01:51 UTC |