Skip to content

Commit

Permalink
Merge pull request ua-parser#508 from romenrg/patch-1
Browse files Browse the repository at this point in the history
Fix: As iOS & tvOS, watchOS apps can have ' ' or / before version digits
  • Loading branch information
commenthol authored Nov 10, 2021
2 parents dfb67d2 + 32a82ad commit e66bdb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ os_parsers:
##########
# Apple Watch
##########
- regex: '(watchOS)/(\d+)\.(\d+)(?:\.(\d+)|)'
- regex: '(watchOS)[/ ](\d+)\.(\d+)(?:\.(\d+)|)'
os_replacement: 'WatchOS'

##########################
Expand Down
7 changes: 7 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ test_cases:
patch: '1'
patch_minor:

- user_agent_string: 'BBCNewsUKWatchApp/4.3.0 (Watch1,2; watchOS 3.2.2)'
family: 'WatchOS'
major: '3'
minor: '2'
patch: '2'
patch_minor:

- user_agent_string: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true'
family: 'Android'
major:
Expand Down

0 comments on commit e66bdb4

Please sign in to comment.