#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)iPhone1[1-7],\d|iPad((7,1[12])|(8,\d+)|1[1-6],\d+)|Watch(5,1[12]|[6-7],\d+)"
Local $sString = "https://support.apple.com/guide/iphone/iphone-models-compatible-with-ios-18-iphe3fa5df43/ios" & @CRLF & _
"https://support.apple.com/guide/ipad/ipad-models-compatible-with-ipados-18-ipad213a25b2/ipados" & @CRLF & _
"https://www.apple.com/watchos/watchos-11/" & @CRLF & _
"" & @CRLF & _
"Published Date: June 10, 2024" & @CRLF & _
"Updated November 1, 2024" & @CRLF & _
"" & @CRLF & _
"Verification: https://regex101.com/r/0UDJHk/7" & @CRLF & _
"" & @CRLF & _
"1) Exact regex — Matches major model identifier numbers based on Jamf's hardware model identifiers list (more accurate):" & @CRLF & _
"" & @CRLF & _
"^iPhone1[1-7],\d|iPad((7,1[12])|(8,\d+)|1[1-6],\d+)|Watch(5,1[12]|[6-7],\d+)$" & @CRLF & _
"" & @CRLF & _
"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)." & @CRLF & _
"" & @CRLF & _
"^iPhone1[1-9],\d+|iPad((7,1[12])|(8,\d+)|1[1-9],\d+)|Watch(5,1[12]|[6-9],\d+)$" & @CRLF & _
"" & @CRLF & _
"Either regex will match any of the supported following model identifiers:" & @CRLF & _
"" & @CRLF & _
"iPhone" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPhone1[1-7],\d$" & @CRLF & _
"Current or higher regex: ^iPhone1[1-9],\d$" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"iPhone17,4 [iPhone 16 Plus]" & @CRLF & _
"iPhone17,3 [iPhone 16]" & @CRLF & _
"iPhone17,2 [iPhone 16 Pro Max]" & @CRLF & _
"iPhone17,1 [iPhone 16 Pro]" & @CRLF & _
"iPhone16,2 [iPhone 15 Pro Max]" & @CRLF & _
"iPhone16,1 [iPhone 15 Pro]" & @CRLF & _
"iPhone15,5 [iPhone 15 Plus]" & @CRLF & _
"iPhone15,4 [iPhone 15]" & @CRLF & _
"iPhone15,3 [iPhone 14 Pro Max]" & @CRLF & _
"iPhone15,2 [iPhone 14 Pro]" & @CRLF & _
"iPhone14,8 [iPhone 14 Plus]" & @CRLF & _
"iPhone14,7 [iPhone 14]" & @CRLF & _
"iPhone14,6 [iPhone SE (3rd Generation)]" & @CRLF & _
"iPhone14,2 [iPhone 13 Pro]" & @CRLF & _
"iPhone14,3 [iPhone 13 Pro Max]" & @CRLF & _
"iPhone14,4 [iPhone 13 mini]" & @CRLF & _
"iPhone14,5 [iPhone 13]" & @CRLF & _
"iPhone13,4 [iPhone 12 Pro Max]" & @CRLF & _
"iPhone13,3 [iPhone 12 Pro]" & @CRLF & _
"iPhone13,2 [iPhone 12]" & @CRLF & _
"iPhone13,1 [iPhone 12 mini]" & @CRLF & _
"iPhone12,8 [iPhone SE (2nd Generation)]" & @CRLF & _
"iPhone12,5 [iPhone 11 Pro Max]" & @CRLF & _
"iPhone12,3 [iPhone 11 Pro]" & @CRLF & _
"iPhone12,1 [iPhone 11]" & @CRLF & _
"iPhone11,8 [iPhone XR]" & @CRLF & _
"iPhone11,6 [iPhone XS Max]" & @CRLF & _
"iPhone11,4 [iPhone XS Max]" & @CRLF & _
"iPhone11,2 [iPhone XS]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"iPhone10,6 (iPhone X)" & @CRLF & _
"iPhone10,5 (iPhone 8 Plus)" & @CRLF & _
"iPhone10,4 (iPhone 8)" & @CRLF & _
"iPhone10,3 (iPhone X)" & @CRLF & _
"iPhone10,2 (iPhone 8 Plus)" & @CRLF & _
"iPhone10,1 (iPhone 8)" & @CRLF & _
"iPhone9,4 (iPhone 7 Plus)" & @CRLF & _
"iPhone9,3 (iPhone 7)" & @CRLF & _
"iPhone9,2 (iPhone 7 Plus)" & @CRLF & _
"iPhone9,1 (iPhone 7)" & @CRLF & _
"iPhone8,4 (iPhone SE)" & @CRLF & _
"iPhone8,2 (iPhone 6S Plus)" & @CRLF & _
"iPhone8,1 (iPhone 6S)" & @CRLF & _
"iPhone7,2 (iPhone 6)" & @CRLF & _
"iPhone7,1 (iPhone 6 Plus)" & @CRLF & _
"iPhone6,2 (iPhone 5S (CDMA))" & @CRLF & _
"iPhone6,1 (iPhone 5S (GSM))" & @CRLF & _
"iPhone5,4 (iPhone 5C (CDMA))" & @CRLF & _
"iPhone5,3 (iPhone 5C (GSM))" & @CRLF & _
"iPhone5,2 (iPhone 5 (CDMA))" & @CRLF & _
"iPhone5,1 (iPhone 5 (GSM))" & @CRLF & _
"iPhone4,1 (iPhone 4S)" & @CRLF & _
"iPhone3,3 (iPhone 4 (CDMA))" & @CRLF & _
"iPhone3,1 (iPhone 4 (GSM))" & @CRLF & _
"iPhone2,1 (iPhone 3GS)" & @CRLF & _
"iPhone1,2 (iPhone 3G)" & @CRLF & _
"iPhone1,1 (iPhone (Original))" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"All supported iPads" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPad(7,1[12]|(8|1[1-6]),\d+)$" & @CRLF & _
"Current or higher regex: Not available" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"iPad" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPad(7,(1[12])|11,[67]|12,[12]|13,1[89])$" & @CRLF & _
"Current or higher regex: Not available" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"iPad13,19 [iPad 10th Generation (Wi-Fi/Cellular)]" & @CRLF & _
"iPad13,18 [iPad 10th Generation (Wi-Fi)]" & @CRLF & _
"iPad12,2 [iPad 9th generation (Cellular)]" & @CRLF & _
"iPad12,1 [iPad 9th generation (Wi-Fi)]" & @CRLF & _
"iPad11,7 [iPad 8th generation (Cellular)]" & @CRLF & _
"iPad11,6 [iPad 8th generation (Wi-Fi)]" & @CRLF & _
"iPad7,12 [iPad 7th Generation (Cellular)]" & @CRLF & _
"iPad7,11 [iPad 7th Generation (Wi-Fi)]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"iPad7,6 [iPad 6th Generation (Cellular)]" & @CRLF & _
"iPad7,5 [iPad 6th Generation (Wi-Fi)]" & @CRLF & _
"iPad6,12 [iPad 5th Generation (Cellular)]" & @CRLF & _
"iPad6,11 [iPad 5th Generation (Wi-Fi)]" & @CRLF & _
"iPad3,6 [iPad 4th Generation (GSM)]" & @CRLF & _
"iPad3,5 [iPad 4th Generation (CDMA)]" & @CRLF & _
"iPad3,4 [iPad 4th Generation (Wi-Fi)]" & @CRLF & _
"iPad3,3 [iPad 3rd Generation (GSM)]" & @CRLF & _
"iPad3,2 [iPad 3rd Generation (CDMA)]" & @CRLF & _
"iPad3,1 [iPad 3rd Generation (Wi-Fi)]" & @CRLF & _
"iPad2,4 [iPad 2 (Wi-Fi)]" & @CRLF & _
"iPad2,3 [iPad 2 (CDMA)]" & @CRLF & _
"iPad2,2 [iPad 2 (GSM)]" & @CRLF & _
"iPad2,1 [iPad 2 (Wi-Fi)]" & @CRLF & _
"iPad1,2 [iPad (3G)]" & @CRLF & _
"iPad1,1 [iPad (Original)]" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"iPad Air" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPad1((1,[34])|3,(1$|1[67]|2)+|4,(1[01]|8|9))$" & @CRLF & _
"Current or higher regex: Not available" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"iPad14,11 [iPad Air 13-inch (M2)]" & @CRLF & _
"iPad14,10 [iPad Air 13-inch (M2)]" & @CRLF & _
"iPad14,9 [iPad Air 11-inch (M2)]" & @CRLF & _
"iPad14,8 [iPad Air 11-inch (M2)]" & @CRLF & _
"iPad13,17 [iPad Air 5th generation (Cellular)]" & @CRLF & _
"iPad13,16 [iPad Air 5th generation (Wi-Fi)]" & @CRLF & _
"iPad13,2 [iPad Air 4th generation (Cellular)]" & @CRLF & _
"iPad13,1 [iPad Air 4th generation (Wi-Fi)]" & @CRLF & _
"iPad11,4 [iPad Air 3rd generation (Cellular)]" & @CRLF & _
"iPad11,3 [iPad Air 3rd generation (Wi-Fi)]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"iPad5,4 (iPad Air 2 (CDMA))" & @CRLF & _
"iPad5,3 (iPad Air 2 (Wi-Fi))" & @CRLF & _
"iPad4,2 (iPad Air (GSM))" & @CRLF & _
"iPad4,1 (iPad Air (Wi-Fi))" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"iPad mini" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPad1(1,[12]|4,[12])$" & @CRLF & _
"Current or higher regex: Not available" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"iPad14,2 [iPad mini 6th generation (Cellular)]" & @CRLF & _
"iPad14,1 [iPad mini 6th generation (Wi-Fi)]" & @CRLF & _
"iPad11,2 [iPad mini 5th generation (Cellular)]" & @CRLF & _
"iPad11,1 [iPad mini 5th generation (Wi-Fi)]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"iPad5,2 (iPad mini 4 (GSM))" & @CRLF & _
"iPad5,1 (iPad mini 4 (Wi-Fi))" & @CRLF & _
"iPad4,8 (iPad mini 3 (GSM))" & @CRLF & _
"iPad4,7 (iPad mini 3 (Wi-Fi))" & @CRLF & _
"iPad4,5 (iPad mini 2nd Generation (GSM))" & @CRLF & _
"iPad4,4 (iPad mini 2nd Generation (Wi-Fi))" & @CRLF & _
"iPad2,7 (iPad mini (CDMA))" & @CRLF & _
"iPad2,6 (iPad mini (GSM))" & @CRLF & _
"iPad2,5 (iPad mini (Wi-Fi Only))" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"iPad Pro" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^iPad((8,[1-4]$|8,[1-9]\d?)|13,([4-9]|1[01])|14,[3456]|16,[3-6])$" & @CRLF & _
"Current or higher regex: Not available" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"iPad16,6 [iPad Pro 13-inch (M4)]" & @CRLF & _
"iPad16,5 [iPad Pro 13-inch (M4)]" & @CRLF & _
"iPad16,4 [iPad Pro 11-inch (M4)]" & @CRLF & _
"iPad16,3 [iPad Pro 11-inch (M4)]" & @CRLF & _
"iPad14,6 [iPad Pro (12.9-inch Wi-Fi/Cellular) (6th generation)]" & @CRLF & _
"iPad14,5 [iPad Pro (12.9-inch) (6th generation)]" & @CRLF & _
"iPad14,4 [iPad Pro (11-inch Wi-Fi/Cellular) (4th generation)]" & @CRLF & _
"iPad14,3 [iPad Pro (11-inch) (4th generation)]" & @CRLF & _
"iPad13,11 [iPad Pro (12.9-inch) (5th generation)]" & @CRLF & _
"iPad13,10 [iPad Pro (12.9-inch) (5th generation)]" & @CRLF & _
"iPad13,9 [iPad Pro (12.9-inch) (5th generation)]" & @CRLF & _
"iPad13,8 [iPad Pro (12.9-inch) (5th generation)]" & @CRLF & _
"iPad13,7 [iPad Pro (11-inch) (3rd generation)]" & @CRLF & _
"iPad13,6 [iPad Pro (11-inch) (3rd generation)]" & @CRLF & _
"iPad13,5 [iPad Pro (11-inch) (3rd generation)]" & @CRLF & _
"iPad13,4 [iPad Pro (11-inch) (3rd generation)]" & @CRLF & _
"iPad8,12 [iPad Pro (12.9-inch Cellular) (4th Generation)]" & @CRLF & _
"iPad8,11 [iPad Pro (12.9-inch Wi-Fi) (4th Generation)]" & @CRLF & _
"iPad8,10 [iPad Pro (11-inch Cellular) (2nd Generation)]" & @CRLF & _
"iPad8,9 [iPad Pro (11-inch Wi-Fi) (2nd Generation)]" & @CRLF & _
"iPad8,8 [iPad Pro (12.9-inch 1TB Cellular)]" & @CRLF & _
"iPad8,7 [iPad Pro (12.9-inch Cellular) (3rd Generation)]" & @CRLF & _
"iPad8,6 [iPad Pro (12.9-inch 1TB Wi-Fi)]" & @CRLF & _
"iPad8,5 [iPad Pro (12.9-inch Wi-Fi) (3rd Generation)]" & @CRLF & _
"iPad8,4 [iPad Pro (11-inch 1TB Cellular)]" & @CRLF & _
"iPad8,3 [iPad Pro (11-inch Cellular)]" & @CRLF & _
"iPad8,2 [iPad Pro (11-inch 1TB Wi-Fi)]" & @CRLF & _
"iPad8,1 [iPad Pro (11-inch Wi-Fi)]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"iPad6,8 (iPad Pro (12.9-inch Cellular))" & @CRLF & _
"iPad6,7 (iPad Pro (12.9-inch Wi-Fi))" & @CRLF & _
"iPad6,4 (iPad Pro (9.7-inch Cellular))" & @CRLF & _
"iPad6,3 (iPad Pro (9.7-inch Wi-Fi))" & @CRLF & _
"" & @CRLF & _
"---------------------------------------------------" & @CRLF & _
"" & @CRLF & _
"Apple Watch" & @CRLF & _
"https://hw-model-names.services.jamfcloud.com/1/mobileDeviceModels.xml" & @CRLF & _
"" & @CRLF & _
"Exact regex: ^Watch(5,1[12]|[6-7],\d+)$" & @CRLF & _
"Current or higher regex: ^Watch(5,1[12]|([6-9]|1[0-9]),\d+)$" & @CRLF & _
"" & @CRLF & _
"Supported:" & @CRLF & _
"Watch7,11 [Apple Watch Series 10 46mm case (GPS+Cellular)]" & @CRLF & _
"Watch7,10 [Apple Watch Series 10 42mm case (GPS+Cellular)]" & @CRLF & _
"Watch7,9 [Apple Watch Series 10 46mm case (GPS)]" & @CRLF & _
"Watch7,8 [Apple Watch Series 10 42mm case (GPS)]" & @CRLF & _
"Watch7,5 [Apple Watch Ultra 2 (49mm)]" & @CRLF & _
"Watch7,4 [Apple Watch Series 9 (45mm Cellular)]" & @CRLF & _
"Watch7,3 [Apple Watch Series 9 (41mm Cellular)]" & @CRLF & _
"Watch7,2 [Apple Watch Series 9 (45mm GPS)]" & @CRLF & _
"Watch7,1 [Apple Watch Series 9 (41mm GPS)]" & @CRLF & _
"Watch6,18 [Apple Watch Ultra (49mm)]" & @CRLF & _
"Watch6,17 [Apple Watch Series 8 (45mm Cellular)]" & @CRLF & _
"Watch6,16 [Apple Watch Series 8 (41mm Cellular)]" & @CRLF & _
"Watch6,15 [Apple Watch Series 8 (45mm GPS)]" & @CRLF & _
"Watch6,14 [Apple Watch Series 8 (41mm GPS)]" & @CRLF & _
"Watch6,13 [Apple Watch SE 2 (44mm Cellular)]" & @CRLF & _
"Watch6,12 [Apple Watch SE 2 (40mm Cellular)]" & @CRLF & _
"Watch6,11 [Apple Watch SE 2 (44mm GPS)]" & @CRLF & _
"Watch6,10 [Apple Watch SE 2 (40mm GPS)]" & @CRLF & _
"Watch6,9 [Apple Watch Series 7 (45mm Cellular)]" & @CRLF & _
"Watch6,8 [Apple Watch Series 7 (41mm Cellular)]" & @CRLF & _
"Watch6,7 [Apple Watch Series 7 (45mm GPS)]" & @CRLF & _
"Watch6,6 [Apple Watch Series 7 (41mm GPS)]" & @CRLF & _
"Watch6,4 [Apple Watch Series 6 (44mm Cellular)]" & @CRLF & _
"Watch6,3 [Apple Watch Series 6 (40mm Cellular)]" & @CRLF & _
"Watch6,2 [Apple Watch Series 6 (44mm GPS)]" & @CRLF & _
"Watch6,1 [Apple Watch Series 6 (40mm GPS)]" & @CRLF & _
"Watch5,12 [Apple Watch SE (44mm Cellular)]" & @CRLF & _
"Watch5,11 [Apple Watch SE (40mm Cellular)]" & @CRLF & _
"" & @CRLF & _
"Unsupported:" & @CRLF & _
"Watch5,10 [Apple Watch SE (44mm GPS)]" & @CRLF & _
"Watch5,9 [Apple Watch SE (40mm GPS)]" & @CRLF & _
"Watch5,4 [Apple Watch Series 5 (44mm Cellular)]" & @CRLF & _
"Watch5,3 [Apple Watch Series 5 (40mm Cellular)]" & @CRLF & _
"Watch5,2 [Apple Watch Series 5 (44mm GPS)]" & @CRLF & _
"Watch5,1 [Apple Watch Series 5 (40mm GPS)]" & @CRLF & _
"Watch4,4 [Apple Watch Series 4 (44mm Cellular)]" & @CRLF & _
"Watch4,3 [Apple Watch Series 4 (40mm Cellular)]" & @CRLF & _
"Watch4,2 [Apple Watch Series 4 (44mm GPS)]" & @CRLF & _
"Watch4,1 [Apple Watch Series 4 (40mm GPS)]"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm