Couldn't you just use a regular expression?

http://www.regular-expressions.info/tutorial.html

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