pseudosocrates has asked for the wisdom of the Perl Monks concerning the following question:
@lines = ( "0|aa aa|1998|aaa a|a aaa|10|aa a aa", "1|bbb aa|1992|fa a|gaa|5|gfsa aa", "2|aa ba|1997|afa|hhaa|1|asdf aa", "3|cccaa|1997|ssa s|hhava|3|gfdh gaa", "4|adaa|1994|g a a|jiua|6|angf a" ); @lines = sort {lc(($b =~ /(\|[\w\s]+){2}/)[0]) <=> lc(($a =~ /(\|[\w\s +]+){2}/)[0]) } @lines; foreach $line (@lines){print "$line\n";}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Just a regex quickie
by dragonchild (Archbishop) on Jun 02, 2004 at 15:08 UTC | |
| |
|
Re: Just a regex quickie
by fizbin (Chaplain) on Jun 02, 2004 at 15:41 UTC | |
by pseudosocrates (Sexton) on Jun 02, 2004 at 15:53 UTC | |
|
Re: Just a regex quickie
by Not_a_Number (Prior) on Jun 02, 2004 at 16:25 UTC |