From: ts Date: 2006-06-29T02:04:31+09:00 Subject: Re: remove all illegal chars form string >>>>> "t" == thomas coopman writes: t> Is there a simple way to remove all but the legal chars from a string. t> where the legal chars are for example: a-z A-Z 0-9 t> So everything should be removed from the string but these characters. t> "exam@p Le3|�" --> "exampLe" Well you can try with String#tr moulon% ruby -e 'p "exam@p Le3|�".tr("^a-zA-Z0-9", "")' "exampLe3" moulon% which means replace all characters, except a-z A-Z 0-9, with "" Guy Decoux