From: Tom Werner Date: 2006-07-22T03:05:55+09:00 Subject: Re: Newbie Question: delete all non alphanumeric characters 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