From: Jeremy Tregunna Date: 2006-07-22T05:35:28+09:00 Subject: Re: Newbie Question: delete all non alphanumeric characters On 21-Jul-06, at 4:19 PM, Tom Werner wrote: > dominique.plante@gmail.com wrote: >> for fun, I started irb, then typed >> >> "567576hgjhgjh&**)".gsub(/^[0-9a-z]/i, '') >> >> It returned >> >> 67576hgjhgjh&**) >> >> > > The carat goes inside the brackets (it inverses the character class) And it should look like this: "567576hgjhgjh&**)".sub(/[^0-9a-zA-Z]+/i, '') Note the + > Tom -- Jeremy Tregunna jtregunna@blurgle.ca "One serious obstacle to the adoption of good programming languages is the notion that everything has to be sacrificed for speed. In computer languages as in life, speed kills." -- Mike Vanier