title: Extracting the anchor from a URL in ruby
body: <p>I looked through the <a href="http://www.ruby-doc.org/stdlib-2.0/libdoc/uri/rdoc/index.html" rel="noreferrer">documentation of the URI class</a> in ruby but couldn't find a way to extract the anchor (HTML) from the instance. For example, in</p>
  
  <pre><code>http://example.com/index.php?q=something#anchor
  </code></pre>
  
  <p>I would like to get the <code>anchor</code> text. Trivial solution is to manipulate the text with regular expressions but if there is some method for it, then it's much better.</p>