$slurp.=$_ while <DATA>; @array=split/^=+([\w\s]+)=+$/ms, $slurp; use Data::Dumper; print Dumper \@array; __DATA__ {{{your data}}}
you can easily extend it to split successively at different header levels. (take care that the first element is always the text preceding the first header)
when processing large texts you should consider using the flip-flop operator with parsing per line instead of splitting whole texts.
Cheers Rolf
In reply to Re: Regular Expressions Challenge
by LanX
in thread Regular Expressions Challenge
by danj35
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |