Trying to pull the version off of the Chrome user agent which is formatted like "Chrome/34.0.1847.116".
This is working:
userAgent.match(/.*Chrome.*?([\d|\.]*)\s/i);
This is not working (and I'm trying to get it working):
var versionRegularExpression = new RegExp('.*'+'Chrome'+'.*?([\d|\.]*)\s', 'i');
userAgent.match(versionRegularExpression);
I must be formatting my new RegExp incorrectly - can anyone tell me how I am messing up?
The full user agent is:
var userAgent = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36';