This repository has been archived by the owner on Jul 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 497
/
regexes.yaml
457 lines (346 loc) · 13.9 KB
/
regexes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
user_agent_parsers:
#### SPECIAL CASES TOP ####
# must go before Opera
- regex: '^(Opera)/(\d+)\.(\d+) \(Nintendo Wii'
family_replacement: 'Wii'
# must go before Firefox to catch SeaMonkey.
- regex: '(SeaMonkey|Fennec|Camino)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*)'
# must go before Firefox
# must go before Browser/major_version.minor_version - eg: Minefield/3.1a1pre
- regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)\.(\d+(?:pre)?)'
family_replacement: 'Firefox ($1)'
- regex: '(Firefox)/(\d+)\.(\d+)([ab]\d+[a-z]*)'
family_replacement: 'Firefox Beta'
- regex: '(Firefox)-(?:\d+\.\d+)?/(\d+)\.(\d+)([ab]\d+[a-z]*)'
family_replacement: 'Firefox Beta'
- regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)([ab]\d+[a-z]*)?'
family_replacement: 'Firefox ($1)'
- regex: '(Firefox).*Tablet browser (\d+)\.(\d+)\.(\d+)'
family_replacement: 'MicroB'
- regex: '(MozillaDeveloperPreview)/(\d+)\.(\d+)([ab]\d+[a-z]*)?'
# e.g.: Flock/2.0b2
- regex: '(Flock)/(\d+)\.(\d+)(b\d+?)'
# RockMelt
- regex: '(RockMelt)/(\d+)\.(\d+)\.(\d+)'
# e.g.: Fennec/0.9pre
- regex: '(Fennec)/(\d+)\.(\d+)(pre)'
- regex: '(Navigator)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Netscape'
- regex: '(Navigator)/(\d+)\.(\d+)([ab]\d+)'
family_replacement: 'Netscape'
- regex: '(Netscape6)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Netscape'
- regex: '(MyIBrow)/(\d+)\.(\d+)'
family_replacement: 'My Internet Browser'
# Opera will stop at 9.80 and hide the real version in the Version string.
# see: http://dev.opera.com/articles/view/opera-ua-string-changes/
- regex: '(Opera Tablet).*Version\/(\d+)\.(\d+)(?:\.(\d+))?'
- regex: '(Opera)/.+Opera Mobi.+Version/(\d+)\.(\d+)'
family_replacement: 'Opera Mobile'
- regex: '(Opera Mini)/(\d+)\.(\d+)'
- regex: '(Opera)/9.80.*Version\/(\d+)\.(\d+)(?:\.(\d+))?'
# Palm WebOS looks a lot like Safari.
- regex: '(webOS)/(\d+)\.(\d+)'
family_replacement: 'Palm webOS'
# LuaKit has no version info.
# http://luakit.org/projects/luakit/
- regex: '(luakit)'
family_replacement: 'LuaKit'
# Lightning (for Thunderbird)
# http://www.mozilla.org/projects/calendar/lightning/
- regex: '(Lightning)/(\d+)\.(\d+)([ab]?\d+[a-z]*)'
# Swiftfox
- regex: '(Firefox)/(\d+)\.(\d+)\.(\d+(?:pre)?) \(Swiftfox\)'
family_replacement: 'Swiftfox'
- regex: '(Firefox)/(\d+)\.(\d+)([ab]\d+[a-z]*)? \(Swiftfox\)'
family_replacement: 'Swiftfox'
# Rekonq
- regex: 'rekonq'
family_replacement: 'Rekonq'
# Conkeror lowercase/uppercase
# http://conkeror.org/
- regex: '(conkeror|Conkeror)/(\d+)\.(\d+)\.?(\d+)?'
family_replacement: 'Conkeror'
# catches lower case konqueror
- regex: '(konqueror)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Konqueror'
- regex: '(PlayBook).+RIM Tablet OS (\d+)\.(\d+)\.(\d+)'
- regex: '(WeTab)-Browser'
- regex: '(wOSBrowser).+TouchPad/(\d+)\.(\d+)'
family_replacement: 'webOS TouchPad'
- regex: '(Comodo_Dragon)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Comodo Dragon'
# YottaaMonitor bot
- regex: '(YottaaMonitor)'
# must go before NetFront below
- regex: '(Kindle)/(\d+)\.(\d+)'
# must go before Android below.
- regex: '(CrMo)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Chrome Mobile'
#### END SPECIAL CASES TOP ####
#### MAIN CASES - this catches > 50% of all browsers ####
# Browser/major_version.minor_version.beta_version
- regex: '(AdobeAIR|Chromium|FireWeb|Jasmine|ANTGalio|Midori|Fresco|Lobo|PaleMoon|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Shiira|Sunrise|Chrome|Flock|Netscape|Lunascape|Epiphany|WebPilot|Vodafone|NetFront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|ThunderBrowse|Iron|Iris)/(\d+)\.(\d+)\.(\d+)'
# Browser/major_version.minor_version
- regex: '(Bolt|Jasmine|IceCat|Skyfire|Midori|Maxthon|Lynx|Arora|IBrowse|Dillo|Camino|Shiira|Fennec|Phoenix|Chrome|Flock|Netscape|Lunascape|Epiphany|WebPilot|Opera Mini|Opera|Vodafone|NetFront|Konqueror|Googlebot|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|iCab|NetNewsWire|Iron|Space Bison|Stainless|Orca|Dolfin|BOLT)/(\d+)\.(\d+)'
# Browser major_version.minor_version.beta_version (space instead of slash)
- regex: '(iRider|Crazy Browser|SkipStone|iCab|Lunascape|Sleipnir|Maemo Browser) (\d+)\.(\d+)\.(\d+)'
# Browser major_version.minor_version (space instead of slash)
- regex: '(iCab|Lunascape|Opera|Android) (\d+)\.(\d+)\.?(\d+)?'
# IE Mobile
- regex: '(IEMobile)[ /](\d+)\.(\d+)'
family_replacement: 'IE Mobile'
# desktop mode
# http://www.anandtech.com/show/3982/windows-phone-7-review
- regex: '(MSIE) (\d+)\.(\d+).*XBLWP7'
family_replacement: 'IE Mobile'
# AFTER THE EDGE CASES ABOVE!
- regex: '(Firefox)/(\d+)\.(\d+)\.(\d+)'
- regex: '(Firefox)/(\d+)\.(\d+)(pre|[ab]\d+[a-z]*)?'
#### END MAIN CASES ####
#### SPECIAL CASES ####
- regex: '(Obigo|OBIGO)[^\d]*(\d+)(?:.(\d+))?'
family_replacement: 'Obigo'
- regex: '(MAXTHON|Maxthon) (\d+)\.(\d+)'
family_replacement: 'Maxthon'
- regex: '(Maxthon|MyIE2|Uzbl|Shiira)'
v1_replacement: '0'
- regex: '(PLAYSTATION) (\d+)'
family_replacement: 'PlayStation'
- regex: '(PlayStation Portable)[^\d]+(\d+).(\d+)'
- regex: '(BrowseX) \((\d+)\.(\d+)\.(\d+)'
- regex: '(POLARIS)/(\d+)\.(\d+)'
family_replacement: 'Polaris'
- regex: '(BonEcho)/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Bon Echo'
- regex: '(iPod).+Version/(\d+)\.(\d+)\.(\d+)'
- regex: '(iPhone) OS (\d+)_(\d+)(?:_(\d+))?'
- regex: '(iPad).+ OS (\d+)_(\d+)(?:_(\d+))?'
- regex: '(Avant)'
v1_replacement: '1'
- regex: '(Nokia)[EN]?(\d+)'
# BlackBerry devices
- regex: '(Black[bB]erry).+Version\/(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Blackberry'
- regex: '(Black[bB]erry)\s?(\d+)'
family_replacement: 'Blackberry'
- regex: '(OmniWeb)/v(\d+)\.(\d+)'
- regex: '(Blazer)/(\d+)\.(\d+)'
family_replacement: 'Palm Blazer'
- regex: '(Pre)/(\d+)\.(\d+)'
family_replacement: 'Palm Pre'
- regex: '(Links) \((\d+)\.(\d+)'
- regex: '(QtWeb) Internet Browser/(\d+)\.(\d+)'
#- regex: '\(iPad;.+(Version)/(\d+)\.(\d+)(?:\.(\d+))?.*Safari/'
# family_replacement: 'iPad'
# Amazon Silk, should go before Safari
- regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+))?'
# Safari
- regex: '(Version)/(\d+)\.(\d+)(?:\.(\d+))?.*Safari/'
family_replacement: 'Safari'
# Safari didn't provide "Version/d.d.d" prior to 3.0
- regex: '(Safari)/\d+'
- regex: '(OLPC)/Update(\d+)\.(\d+)'
- regex: '(OLPC)/Update()\.(\d+)'
v1_replacement: '0'
- regex: '(SamsungSGHi560)'
family_replacement: 'Samsung SGHi560'
- regex: '^(SonyEricssonK800i)'
family_replacement: 'Sony Ericsson K800i'
- regex: '(Teleca Q7)'
- regex: '(MSIE) (\d+)\.(\d+)'
family_replacement: 'IE'
os_parsers:
##########
# Windows
# http://en.wikipedia.org/wiki/Windows_NT#Releases
# possibility of false positive when different marketing names share same NT kernel
# e.g. windows server 2003 and windows xp
# lots of ua strings have Windows NT 4.1 !?!?!?!? !?!? !? !????!?! !!! ??? !?!?! ?
# (very) roughly ordered in terms of frequency of occurence of regex (win xp currently most frequent, etc)
##########
- regex: '(Windows (?:NT 5\.2|NT 5\.1))'
os_replacement: 'Windows XP'
# ie mobile des ktop mode
# spoofs nt 6.1. must come before windows 7
- regex: '(XBLWP7)'
os_replacement: 'Windows Phone OS'
- regex: '(Windows NT 6\.1)'
os_replacement: 'Windows 7'
- regex: '(Windows NT 6\.0)'
os_replacement: 'Windows Vista'
- regex: '(Windows 98|Windows XP|Windows ME|Windows 95|Windows CE|Windows 7|Windows NT 4\.0|Windows Vista|Windows 2000)'
# is this a spoof or is nt 6.2 out and about in some capacity?
- regex: '(Windows NT 6\.2)'
os_replacement: 'Windows 8'
- regex: '(Windows NT 5\.0)'
os_replacement: 'Windows 2000'
- regex: '(Windows Phone OS) (\d+)\.(\d+)'
- regex: '(Windows ?Mobile)'
os_replacement: 'Windows Mobile'
- regex: '(WinNT4.0)'
os_replacement: 'Windows NT 4.0'
- regex: '(Win98)'
os_replacement: 'Windows 98'
##########
# Android
# can actually detect rooted android os. do we care?
##########
- regex: '(Android) (\d+)\.(\d+)(?:[.\-]([a-z0-9]+))?'
- regex: '(Android) Donut'
os_v1_replacement: '1'
os_v2_replacement: '2'
- regex: '(Android) Eclair'
os_v1_replacement: '2'
os_v2_replacement: '1'
- regex: '(Android) Froyo'
os_v1_replacement: '2'
os_v2_replacement: '2'
- regex: '(Android) Gingerbread'
os_v1_replacement: '2'
os_v2_replacement: '3'
- regex: '(Android) Honeycomb'
os_v1_replacement: '3'
##########
# Mac OS
# http://en.wikipedia.org/wiki/Mac_OS_X#Versions
##########
- regex: '(Mac OS X) (\d+)[_.](\d+)(?:[_.](\d+))?'
# builds before tiger don't seem to specify version?
# ios devices spoof (mac os x), so including intel/ppc prefixes
- regex: '(?:PPC|Intel) (Mac OS X)'
##########
# iOS
# http://en.wikipedia.org/wiki/IOS_version_history
##########
- regex: '(CPU OS|iPhone OS) (\d+)_(\d+)(?:_(\d+))?'
os_replacement: 'iOS'
# remaining cases are mostly only opera uas, so catch opera as to not catch iphone spoofs
- regex: '(iPhone|iPad|iPod); Opera'
os_replacement: 'iOS'
# few more stragglers
- regex: '(iPhone|iPad|iPod).*Mac OS X'
os_replacement: 'iOS'
##########
# Chrome OS
# if version 0.0.0, probably this stuff:
# http://code.google.com/p/chromium-os/issues/detail?id=11573
# http://code.google.com/p/chromium-os/issues/detail?id=13790
##########
- regex: '(CrOS) [a-z0-9_]+ (\d+)\.(\d+)(?:\.(\d+))?'
os_replacement: 'Chrome OS'
##########
# Linux distros
##########
- regex: '(Debian)-(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
- regex: '(Linux Mint)(?:/(\d+))?'
- regex: '(Mandriva)(?: Linux)?/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
##########
# Symbian + Symbian OS
# http://en.wikipedia.org/wiki/History_of_Symbian
##########
- regex: '(Symbian[Oo][Ss])/(\d+)\.(\d+)'
os_replacement: 'Symbian OS'
- regex: '(Symbian/3)'
os_replacement: 'Symbian^3'
- regex: '(Series 60|SymbOS|S60)'
os_replacement: 'Symbian OS'
##########
# BlackBerry devices
##########
- regex: '(Black[Bb]erry)[0-9a-z]+/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
os_replacement: 'BlackBerry OS'
- regex: '(Black[Bb]erry).+Version/(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?'
os_replacement: 'BlackBerry OS'
- regex: '(RIM Tablet OS) (\d+)\.(\d+)\.(\d+)'
os_replacement: 'BlackBerry Tablet OS'
- regex: '(Play[Bb]ook)'
os_replacement: 'BlackBerry Tablet OS'
- regex: '(Black[Bb]erry)'
os_replacement: 'Blackberry OS'
##########
# Misc mobile
##########
- regex: '(webOS|hpwOS)/(\d+)\.(\d+)(?:\.(\d+))?'
os_replacement: 'webOS'
##########
# Generic patterns
# since the majority of os cases are very specific, these go last
##########
# first.second.third.fourth bits
- regex: '(SUSE|Fedora|Red Hat|PCLinuxOS)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
# first.second.third bits
- regex: '(SUSE|Fedora|Red Hat|Puppy|PCLinuxOS|CentOS)/(\d+)\.(\d+)\.(\d+)'
# first.second bits
- regex: '(Ubuntu|Kindle|Bada|Lubuntu|BackTrack|Red Hat|Slackware)/(\d+)\.(\d+)'
# just os
- regex: '(Windows|OpenBSD|FreeBSD|NetBSD|Ubuntu|Kubuntu|Android|Arch Linux|CentOS|WeTab|Slackware)'
- regex: '(Linux|BSD)'
device_parsers:
##########
# incomplete!
# multiple replacement placeholds i.e. ($1) ($2) help solve problem of single device with multiple representations in ua
# e.g. HTC Dream S should parse to the same device as HTC_DreamS
##########
##########
# incomplete!
# HTC
# http://en.wikipedia.org/wiki/List_of_HTC_phones
# this is quickly getting unwieldy
##########
# SPECIFIC CASES
- regex: '(HTC_VDA_V)'
device_replacement: 'HTC S710'
- regex: '(HTC-P4600)'
device_replacement: 'HTC Touch Pro'
- regex: '(HTCX06HT)'
device_replacement: 'HTC Desire'
- regex: '(HTC-A6366)'
device_replacement: 'HTC Aria'
- regex: 'HTC; (7 Mozart|T8697)'
device_replacement: 'HTC 7 Mozart'
- regex: '(HTC-ST7377)'
device_replacement: 'HTC Touch Pro2'
- regex: 'HTC; 7 Trophy'
device_replacement: 'HTC 7 Trophy'
- regex: 'HTC; HD7'
device_replacement: 'HTC HD7'
# example: Mozilla/5.0 (Linux; U; Android 2.3.2; fr-fr; HTC HD2 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
- regex: 'HTC ([A-Z][a-z0-9]+) Build'
device_replacement: 'HTC ($1)'
# example: Mozilla/5.0 (Linux; U; Android 2.1; es-es; HTC Legend 1.23.161.1 Build/ERD79) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17,gzip
- regex: 'HTC ([A-Z][a-z0-9 ]+) \d+\.\d+\.\d+\.\d+'
device_replacement: 'HTC ($1) ($2)'
# example: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; HTC_Touch_Diamond2_T5353; Windows Phone 6.5.3.5)
- regex: 'HTC_Touch_([A-Za-z0-9]+)'
device_replacement: 'HTC Touch ($1)'
# should come after HTC_Touch
- regex: 'HTC_([A-Za-z0-9]+)'
device: 'HTC ($1)'
- regex: '(HTC)'
##########
# NOKIA
# nokia NokiaN8-00 comes before iphone. sometimes spoofs iphone
##########
- regex: 'Nokia(?!Browser)([A-Za-z0-9\-])+'
device_replacement: 'Nokia ($1)'
- regex: 'Nokia ([A-Za-z0-9\-]+)'
device_replacement: 'Nokia ($1)'
##########
# incomplete!
# PALM
##########
# some palm devices must come before iphone. sometimes spoofs iphone in ua
- regex: '(Pre)/(\d+)\.(\d+)'
device_replacement: 'Palm Pre'
- regex: '(Pixi)/(\d+)\.(\d+)'
device_replacement: 'Palm Pixi'
##########
# complete but probably catches spoofs
# iSTUFF
##########
# ipad and ipod must be parsed before iphone
# cannot determine specific device type from ua string. (3g, 3gs, 4, etc)
- regex: '(iPad);'
- regex: '(iPod);'
- regex: '(iPhone);'