Jillian Kozyra wrote:
> Hi,
> 
> I am looking for a way to do the following:
> 
> I have some html in strings, mostly links (i.e. <a
> href="http://mysite.com">).  I need to delete these lines.  I've been
> trying to do this, but it's not working out:
> 
> question.gsub! ("<a href=\"\/([.]+)\/\" >$/i", "")
> or also: question.gsub! ("<a href=\"\/([a-zA-z0-9]+)\/\" >$/i", "")
> 
> (and various permutations of these two).
> 
> How would one go about this?
> 
> Thanks,
> Jillian

q = 'Hello <a href="http://mysite.com">world<a 
href="http://mysite.com">.'

result = q.gsub(/<a.*?>/, "")
puts result

--output:--
Hello world.
-- 
Posted via http://www.ruby-forum.com/.