Based in your solution and searching on internet I tryied the following aproach and it did work this time .
pattern5 = /<a href=[\'"]?([^\'"> ]*)[\'"]?[^>]*>(.*?)<\/a>/o html.gsub!(pattern5) do |n| "<a href='#{Base64.encode64($1)}'>#{$2}</a>" end puts html I am now able to use $1 and $2 Thanks a lot . Newton Garcia Newx - Soluções para Internet n...@newx.com.br www.newx.com.br On Sep 30, 10:36 am, newx <newxh...@gmail.com> wrote: > Hi Siddick , > > Thanks a lot for your response but ... > It didn't work . html_output outputs the same content as > html variable . > > Newton > > On Sep 30, 4:07 am, Siddick Ebramsha <rails-mailing-l...@andreas- > > s.net> wrote: > > Try this one > > > html_output = html.gsub(pattern) do |link| > > "<a href='http://mysite.com/redirect/#{$1}'>#{$2}</a>" > > end > > > -- > > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---