title: Parse binary in Erlang
body: <p>If I have the following binary: <code>&lt;&lt;"GET <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> HTTP/1.1"&gt;&gt;</code>, how can I split it up so that I can retrieve only the host (<code>http://www.google.com</code>) ?</p>
  
  <p>I started with something like:</p>
  
  <p><code>get_host(&lt;&lt;$G, Rest/binary&gt;&gt;) -&gt; get_host(Rest);<br>
  get_host(&lt;&lt;$E, Rest/binary&gt;&gt;) -&gt; get_host(Rest);<br>
  get_host(&lt;&lt;$T, Rest/binary&gt;&gt;) -&gt; get_host(Rest);</code></p>
  
  <p>but I am not sure how to go on from here. I was thinking of reversing <code>Rest</code> and starting over from the end of the binary.</p>