Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save talkingmoose/a9f11e961393e967458a65ccb6c247de to your computer and use it in GitHub Desktop.
Save talkingmoose/a9f11e961393e967458a65ccb6c247de to your computer and use it in GitHub Desktop.
Regex looks for all iPhone and iPad models compatible with iOS or iPadOS 17. May not be up-to-date with newly released models.
https://www.apple.com/ios/ios-17-preview/
https://www.apple.com/ipados/ipados-17-preview/
Published Date: June 5, 2023
Verification: https://regex101.com/r/m9HV8T/3
1) Exact regex — Matches major model identifier numbers based on Jamf's hardware model identifiers list (more accurate):
^iPhone1[1-5],\d|iPad([7-9]|1[1-4]),\d+$
2) Current or higher regex — Matches model identifiers based on Jamf's hardware model identifiers lists and may match higher versions before this regex is updated (more future-proof).
^iPhone1[1-9],\d|iPad([7-9]|1[1-9]),\d+$
Current or higher regexes aren't available for some iPad models where Apple has used the same model identifier schema for multiple models.
Either regex will match any of the supported following model identifiers:
iPhone
https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml
Exact regex: ^iPhone1[1-5],\d$
Current or higher regex: ^iPhone1[1-9],\d$
Supported:
iPhone15,3 (iPhone 14 Pro Max)
iPhone15,2 (iPhone 14 Pro)
iPhone14,8 (iPhone 14 Plus)
iPhone14,7 (iPhone 14)
iPhone14,6 (iPhone SE (3rd Generation))
iPhone14,5 (iPhone 13)
iPhone14,4 (iPhone 13 mini)
iPhone14,3 (iPhone 13 Pro Max)
iPhone14,2 (iPhone 13 Pro)
iPhone13,4 (iPhone 12 Pro Max)
iPhone13,3 (iPhone 12 Pro)
iPhone13,2 (iPhone 12)
iPhone13,1 (iPhone 12 mini)
iPhone12,8 (iPhone SE (2nd Generation))
iPhone12,5 (iPhone 11 Pro Max)
iPhone12,3 (iPhone 11 Pro)
iPhone12,1 (iPhone 11)
iPhone11,8 (iPhone XR)
iPhone11,6 (iPhone XS Max)
iPhone11,4 (iPhone XS Max)
iPhone11,2 (iPhone XS)
Unsupported:
iPhone10,6 (iPhone X)
iPhone10,5 (iPhone 8 Plus)
iPhone10,4 (iPhone 8)
iPhone10,3 (iPhone X)
iPhone10,2 (iPhone 8 Plus)
iPhone10,1 (iPhone 8)
iPhone9,4 (iPhone 7 Plus)
iPhone9,3 (iPhone 7)
iPhone9,2 (iPhone 7 Plus)
iPhone9,1 (iPhone 7)
iPhone8,4 (iPhone SE)
iPhone8,2 (iPhone 6S Plus)
iPhone8,1 (iPhone 6S)
iPhone7,2 (iPhone 6)
iPhone7,1 (iPhone 6 Plus)
iPhone6,2 (iPhone 5S (CDMA))
iPhone6,1 (iPhone 5S (GSM))
iPhone5,4 (iPhone 5C (CDMA))
iPhone5,3 (iPhone 5C (GSM))
iPhone5,2 (iPhone 5 (CDMA))
iPhone5,1 (iPhone 5 (GSM))
iPhone4,1 (iPhone 4S)
iPhone3,3 (iPhone 4 (CDMA))
iPhone3,1 (iPhone 4 (GSM))
iPhone2,1 (iPhone 3GS)
iPhone1,2 (iPhone 3G)
iPhone1,1 (iPhone (Original))
---------------------------------------------------
All supported iPads
Exact regex: ^iPad([7-9]|1[1-4]),\d+$
Current or higher regex: ^iPad([7-9]|1[1-9]),\d+$
---------------------------------------------------
iPad
https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml
Exact regex: ^iPad(7,([56]|1[12])|11,[67]|12,[12]|13,1[89])$
Current or higher regex: Not available
Supported:
iPad13,19 (iPad 10th Generation (Wi-Fi/Cellular))
iPad13,18 (iPad 10th Generation (Wi-Fi))
iPad12,2 (iPad 9th generation (Cellular))
iPad12,1 (iPad 9th generation (Wi-Fi))
iPad11,7 (iPad 8th generation (Cellular))
iPad11,6 (iPad 8th generation (Wi-Fi))
iPad7,12 (iPad 7th Generation (Cellular))
iPad7,11 (iPad 7th Generation (Wi-Fi))
iPad7,6 (iPad 6th Generation (Cellular))
iPad7,5 (iPad 6th Generation (Wi-Fi))
Unsupported:
iPad6,12 (iPad 5th Generation (Cellular))
iPad6,11 (iPad 5th Generation (Wi-Fi))
iPad3,6 (iPad 4th Generation (GSM))
iPad3,5 (iPad 4th Generation (CDMA))
iPad3,4 (iPad 4th Generation (Wi-Fi))
iPad3,3 (iPad 3rd Generation (GSM))
iPad3,2 (iPad 3rd Generation (CDMA))
iPad3,1 (iPad 3rd Generation (Wi-Fi))
iPad2,4 (iPad 2 (Wi-Fi))
iPad2,3 (iPad 2 (CDMA))
iPad2,2 (iPad 2 (GSM))
iPad2,1 (iPad 2 (Wi-Fi))
iPad1,2 (iPad (3G))
iPad1,1 (iPad (Original))
---------------------------------------------------
iPad Air
https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml
Exact regex: ^iPad1((1,(1$|[34])|3,(1$)|3,2|3,1[67]))$
Current or higher regex: Not available
Supported:
iPad13,17 (iPad Air 5th generation (Cellular))
iPad13,16 (iPad Air 5th generation (Wi-Fi))
iPad13,2 (iPad Air 4th generation (Cellular))
iPad13,1 (iPad Air 4th generation (Wi-Fi))
iPad11,4 (iPad Air 3rd generation (Cellular))
iPad11,3 (iPad Air 3rd generation (Wi-Fi))
Unsupported:
iPad5,4 (iPad Air 2 (CDMA))
iPad5,3 (iPad Air 2 (Wi-Fi))
iPad4,2 (iPad Air (GSM))
iPad4,1 (iPad Air (Wi-Fi))
---------------------------------------------------
iPad mini
https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml
Exact regex: ^iPad1(1,[12]|4,[12])$
Current or higher regex: Not available
Supported:
iPad14,2 (iPad mini 6th generation (Cellular))
iPad14,1 (iPad mini 6th generation (Wi-Fi))
iPad11,2 (iPad mini 5th generation (Cellular))
iPad11,1 (iPad mini 5th generation (Wi-Fi))
Unsupported:
iPad5,2 (iPad mini 4 (GSM))
iPad5,1 (iPad mini 4 (Wi-Fi))
iPad4,8 (iPad mini 3 (GSM))
iPad4,7 (iPad mini 3 (Wi-Fi))
iPad4,5 (iPad mini 2nd Generation (GSM))
iPad4,4 (iPad mini 2nd Generation (Wi-Fi))
iPad2,7 (iPad mini (CDMA))
iPad2,6 (iPad mini (GSM))
iPad2,5 (iPad mini (Wi-Fi Only))
---------------------------------------------------
iPad Pro
https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml
Exact regex: ^iPad((7,[1-4]$|8,[1-9]\d?)|13,([4-9]|1[01])|14,[3456])$
Current or higher regex: Not available
Supported:
iPad14,6 (iPad Pro (12.9-inch Wi-Fi/Cellular) (6th generation))
iPad14,5 (iPad Pro (12.9-inch) (6th generation))
iPad13,11 (iPad Pro (12.9-inch) (5th generation))
iPad13,10 (iPad Pro (12.9-inch) (5th generation))
iPad13,9 (iPad Pro (12.9-inch) (5th generation))
iPad13,8 (iPad Pro (12.9-inch) (5th generation))
iPad14,4 (iPad Pro (11-inch Wi-Fi/Cellular) (4th generation))
iPad14,3 (iPad Pro (11-inch) (4th generation))
iPad13,7 (iPad Pro (11-inch) (3rd generation))
iPad13,6 (iPad Pro (11-inch) (3rd generation))
iPad13,5 (iPad Pro (11-inch) (3rd generation))
iPad13,4 (iPad Pro (11-inch) (3rd generation))
iPad8,12 (iPad Pro (12.9-inch Cellular) (4th Generation))
iPad8,11 (iPad Pro (12.9-inch Wi-Fi) (4th Generation))
iPad8,10 (iPad Pro (11-inch Cellular) (2nd Generation))
iPad8,9 (iPad Pro (11-inch Wi-Fi) (2nd Generation))
iPad8,8 (iPad Pro (12.9-inch 1TB Cellular))
iPad8,7 (iPad Pro (12.9-inch Cellular) (3rd Generation))
iPad8,6 (iPad Pro (12.9-inch 1TB Wi-Fi))
iPad8,5 (iPad Pro (12.9-inch Wi-Fi) (3rd Generation))
iPad8,4 (iPad Pro (11-inch 1TB Cellular))
iPad8,3 (iPad Pro (11-inch Cellular))
iPad8,2 (iPad Pro (11-inch 1TB Wi-Fi))
iPad8,1 (iPad Pro (11-inch Wi-Fi))
iPad7,4 (iPad Pro 2nd Generation (10.5-inch Cellular))
iPad7,3 (iPad Pro 2nd Generation (10.5-inch Wi-Fi))
iPad7,2 (iPad Pro 2nd Generation (12.9-inch Cellular))
iPad7,1 (iPad Pro 2nd Generation (12.9-inch Wi-Fi))
Unsupported:
iPad6,8 (iPad Pro (12.9-inch Cellular))
iPad6,7 (iPad Pro (12.9-inch Wi-Fi))
iPad6,4 (iPad Pro (9.7-inch Cellular))
iPad6,3 (iPad Pro (9.7-inch Wi-Fi))
@ahousseini
Copy link

The regex does not cover Apple TVs, any chance to add those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment