Created
November 8, 2012 20:59
-
-
Save dgershman/4041563 to your computer and use it in GitHub Desktop.
user agent detection with regexp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/12.0.782.220 Safari/535.1"; | |
var found = (new RegExp("Chrome/1[2-3]", "g").exec(str)); | |
alert(found); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment