From: Logan Capaldo Date: 2006-07-22T03:29:20+09:00 Subject: Re: Newbie Question: delete all non alphanumeric characters On Jul 21, 2006, at 2:05 PM, Tom Werner wrote: > Logan Capaldo wrote: >> >> On Jul 21, 2006, at 1:53 PM, Theallnighter Theallnighter wrote: >> >>> Hi all, >>> how can i delete all non alphanumeric characters in a string ? >>> thanks >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >> >> string.gsub(/[0-9a-z]+/i, '') >> >> >> > That deletes all alphanumeric. To delete all non-alphanumeric: > > string.gsub(/[^0-9a-z]/i, '') > > -- > Tom Werner > Helmets to Hardhats > Software Developer > tom@helmetstohardhats.org > www.helmetstohardhats.org > > Doh! I'm obviously not awake yet this ---err-- afternoon.