Detect WebKit Version 525 and Below With RegEx
- by Jay
I'm no good at Regular Expressions, really!
I would like to specifically detect WebKit browsers below version 525.
I have a regular expression [/WebKit\/[\d.]+/.exec(navigator.appVersion)] that correctly returns WebKit/5….…, really, I'd like it to return only the version number, but if the browser isn't WebKit, return null, or better still 0.
For example, if the browser was Trident, Presto or Gecko, return null, whereas if the browser is WebKit, return it's version number.
To clarify, I would like the regular expression to check if navigator.appVersion contains WebKit and if it does not, return null, if it does, return the version number.
I appreciate all your help!
Please let's keep this focused, let's not flirt with jQuery or the sort, it's overkill in this scenario.