$ echo '<ref id="ref1"> <ref id="ref2"> <ref id="ref3"> </end> <ref id="ref4"> <ref id="ref5"> </end> <ref id="ref6"> <ref id="ref7"> <ref id="ref8"> </end>' | perl -lne' if ( /<ref\s+id="([^"]+)">/ ) { push @x, $1 } elsif ( /<\/end>/ ) { print "New Group:", map " $_", splice @x } ' New Group: ref1 ref2 ref3 New Group: ref4 ref5 New Group: ref6 ref7 ref8
In reply to Re: problem with array
by jwkrahn
in thread problem with array
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |