title: Generic regex to get iOS version, all iOS devices
body: <p>I am trying to find a regex that gets the iOS version from all the iOS devices. I can't do one seperately for each device type (iphone, ipad, ipod), I need a generic one.</p>
  
  <p>Before I do the match, I check if it is a valid iOS device. The solution I have come up with is:</p>
  
  <pre><code>Match match = Regex.Match(HttpContext.Current.Request.UserAgent, @"(?&lt;version&gt;\d+(_\d+)+) like Mac OS X");
  string versionNr = match.Groups["version"].ToString().Replace("_", ".");
  </code></pre>
  
  <p>I have checked quite a few devices agent strings, and so far they all match. But I am a bit worried that it wont match all, and just checking if anyone has a better regex.</p>
  
  <p>Thanks in advance.</p>