Now @section will contain all the text after ===Comments===, one chapter at a time.my @section; my $i = -1; foreach (split /\n/, $str) { if (/^===Comments===$/) { ++$i; next; } next unless $i >= 0; $section[$i] .= "$_\n"; }
In reply to Re: Regular Expressions Challenge
by JavaFan
in thread Regular Expressions Challenge
by danj35
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |