v = v.gsub(/[^a-z0-9\s]/i, '');
On Jun 12, 5:12 pm, louis w <[EMAIL PROTECTED]> wrote: > Ok I will admit I suck at making regex patterns. > > I want to transform the value to be all lowercase, _ instead of > spaces, and no special chars. (Basically a websafe filename). Here is > what I have. It works all except stripping out special chars. > > Any help would be great. > > v = v.toLowerCase(); > v = v.gsub(' ', '_'); > v = v.gsub('/[^a-z0-9\s]/i', ''); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---