title: Get Android OS version from user-agent
body: <p>I've been trying to find a parser or regex that will give me the Android OS version from a user agent string.</p>
  
  <p>E.g.</p>
  
  <pre><code>Mozilla/5.0 (Linux; U; Android 2.2.1; fr-fr; Desire HD Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
  </code></pre>
  
  <p>Will return:</p>
  
  <pre><code>2.2.1
  </code></pre>
  
  <p>Can anyone help?</p>