my @data = split /\n/, $str; my @section; my $i = 0; while (@data) { $_ = shift @data; if (/^===Comments===$/) { while (@data) { $_ = shift @data; last if /^=/; $section[$i] .= "$_\n"; } $i++; } }
In reply to Re^3: Regular Expressions Challenge
by JavaFan
in thread Regular Expressions Challenge
by danj35
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |