I have a string like:
<a href="x.com">x.com</a>
..in which I want to replace the text of the tag so it is wrapped in a <i>
tag:
<a href="x.com"><i>x.com</i></a>
Using regex >.*<
, I get a match for >x.com<
but I really just want the exact text so I can gsub
it:
'<a href="x.com">x.com</a>'.gsub(<what here?>,<what here?>)
How do I do this?
UPDATE
Ps. This is in Rails 3.0.3 on Ruby 1.8.7 p330