Looks good, Ruby's pretty amazing when it comes to finding simple ways 
to do complex things.
Are there any parts of that code you need clarifying? It'll help to 
understand all the methods used here so you can write your own more 
easily in future.
For example, you can test regular expressions here: 
http://www.rubular.com/

-- 
Posted via http://www.ruby-forum.com/.