def parse_email_for_anchor_text_link(email, link_text)
      if email.multipart?
        body = email.html_part.body
      else
        body = email.body
      end
      if match_data = body.match(%r{<a[^>]*href=['"]?([^'"]*)['"]?[^>]*?>[^<]*?#{link_text}[^<]*?</a>})
        match_data[1]
      end
    end
def parse_email_for_anchor_text_link(email, link_text)
      if email.multipart?
        body = email.html_part.body
      else
        body = email.body
      end
      if match_data = body.match(%r{<a[^>]*href=['"]?([^'"]*)['"]?[^>]*?>[^<]*?#{link_text}[^<]*?</a>})
        match_data[1]
      end
    end
e.g. Click here in  <a href="http://confirm">Click here</a>