I have a string:
str = "John: hey, what's your name?.. :haha \n Stella: :foo :xx: my name is ... stella :xx:"
I want to replace all smilies in the list ary = [":haha", ":xx:", ":foo", ":bar"] and special characters (except space) with (.*) so that it becomes like this:
John(.*) hey(.*) what(.*)s your name(.*) Stella(.*) my name is (.*) stella (.*)

I tried this:
str.gsub(Regexp.new("^#{ary.join('|')}$")) { |w| "(.*)" }.gsub( /[\W ]+/, "(.*)")
# => "John(.*)hey(.*)what(.*)s(.*)your(.*)name(.*)haha(.*)Stella(.*)my(.*)name(.*)is(.*)stella(.*)"
Problem:
- Space still replace
[\W ]. Change it to[^\w\s]+