I am not very good at regular expressions!
I would like to specifically define WebKit browsers below version 525.
I have a regular expression [ /WebKit/[\d.]+/.exec(navigator.appVersion) ] that correctly returns WebKit/5….… really, I would like it to return only the version number, but if the browser is not 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 its version number.
To clarify, I would like the regular expression to check if navigator.appVersion contains WebKit , and if not, return zero, if so, return the version number.
I appreciate all your help!
Please keep it focused, let it not flirt with jQuery or sort, it digests in this scenario.
source share