Robert Klemme
5/31/2006 4:19:00 PM
Tim Hoolihan wrote:
> sorry that regular expression should have been
>
> return unclean.gsub(/[^A-Z,a-z,0-9, ]+?/,"_")
No. Commas are no meta characters in character classes:
>> ",".gsub(/[^A-Z,a-z,0-9, ]+?/,"_")
=> ","
You rather want
>> ",".gsub(/[^A-Za-z0-9]+?/,"_")
=> "_"
Alternatively this may work as well
>> ",".gsub(/\W/,"_")
=> "_"
Cheers
robert