perl -ne '$,{$_}++for/(?:[\x27\w]+|-(?!--))+/g; END{for(sort{$,{$a}<=>$,{$b}}keys(%,)){printf"%4d: %s\n",$,{$_},$_}}' +file.txt
In reply to Re: homework: Simple matching and sorting
by Anonymous Monk
in thread homework: Simple matching and sorting
by imhotep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |