From: Alan Moen Date: 2006-06-22T03:21:20+09:00 Subject: Why this code doesn't work? Hi, I am trying to replace all html tags and spaces with "*" in a string. I tried this code: "as sd ".sub(/<[\s\S]*?>| /,"*") It just replaces the 1st occurance. This code also doen't work: "as sd ".sub(/<[\s\S]*?>| /){|s| "*"} How can I do that? Thanks, Alan -- Posted via http://www.ruby-forum.com/.