String of alphanumeric characters to a sorted list of comma-separated ranges Given a string of unsorted alphanumeric characters, e.g.

ABC321STPpJqZZr0


output a ", "-separated list of character ranges, sorted by ASCII value, ignoring case and removing duplicates (i.e. outputting only uppercase and numeric characters), e.g.

0-3, A-C, J, P-T, Z


Rules


The length of your program is your base score, as usual.
You must initialize (hardcode) the above example within your program, but you may discount the length of that example from your program length, e.g. for char* s="ABC321STPpJqZZr0"; you may discount 16 chars, the other 11 chars counting toward your program length.


Bonus (+50 bounty)


As this was a real problem encountered by my coworker today, needing to be written in Tcl 8.0.5 (an ancient version, lacking many of the latest Tcl built-ins), I'll award 50 points to whomever writes the shortest Tcl 8.0.5 solution, if there are at least 2 valid submissions in Tcl 8.0.5.
Ruby, 87-16=71

EDIT:  Had to add some characters so that two-character ranges are displayed correctly.  Also using ?[ instead of ?Z to fix a bug with ranges ending in Z.

$&gt;&lt;&lt;[*?0..?[].join.gsub(/[^ABC321STPpJqZZr0]/i,$/).gsub(/\B.+\B/,?-).scan(/.-.|./)*', '


You can see the Ideone run here.