From: James Edward Gray II Date: 2006-06-22T03:24:01+09:00 Subject: Re: Why this code doesn't work? On Jun 21, 2006, at 1:21 PM, Alan Moen wrote: > 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. Try: ...gsub... Hope that helps. James Edward Gray II