From: Craig Moran Date: 2004-12-16T00:34:17+09:00 Subject: Re: Regex extraction > > The other thing I don't know how to do is replace things like & with > &. Is > > there anything in the ruby standard library, maybe in rexml, that > automatically > > takes care of all those standard entities for me? I looked, but I > couldn't find > > one. On replacing & -- This code will replace a few other items that begin with & (ampersand) and end with ; (semicolon) including what you wish to accomplish. text.gsub!(/&.*?;/m) { |i| case i when "&" "&" when " " "" when "©" "" when "®" "" when "“" "`" when "”" "'" when "·" "-" when "·" "-" when "—" "--" else "" end # case }