Hello champs, I am having an string and i want all extra characters to be removed from that string except + and . How to write a regular expression for it.. Currently i am trying it like this as word.sub(/[_-\:\\\/]/, "").. But its not working..
I can do it like this as well:- word.sub(/[\W]/, "") but this will replace all characters even also + and . -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.