Assuming that input starts with some uppercase key and that your keys are uppercase strings I would suggest following:
my $key; while(<>) { if(s/^([A-Z]+)://) { $key = $1 } push @{$hash{$key}}, $_ } # use array consisting 'LENGTH' print @{$hash{'LENGTH'}}
In reply to Re: I need to regex multiple lines
by grizzley
in thread I need to regex multiple lines
by legend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |