Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created February 5, 2023 18:41
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talkingmoose/3100dab934baa13a799ba29be62ca357 to your computer and use it in GitHub Desktop.
Save talkingmoose/3100dab934baa13a799ba29be62ca357 to your computer and use it in GitHub Desktop.
Regex looks for all Mac models compatible with macOS Ventura. May not be up-to-date with newly released models.
https://support.apple.com/en-us/HT213264
Published Date: October 24, 2022
Verification: https://regex101.com/r/nRkAFo/2
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[34]|BookPro1[4-8]|BookAir([89]|10)|Pro7|Book10)|iMac(Pro1|(1[89]|2[01]))|Macmini[89]),\d+$
2) Current or higher regex — Matches model identifiers based on Apple's knowledge base article and may match higher versions before this regex is updated (more future-proof).
^(Mac(1[3-9]|BookPro1[4-8]|BookAir([89]|10)|Pro[7-9]|Book\d{2,})|iMac(Pro\d+|(1[89]|[2-9]\d))|Macmini[89]),\d+$
Current or higher regexes aren't available for some models where Apple has used the same model identifier schema for multiple models.
Either regex will match any of the supported following model identifiers:
MacBook Pro
https://support.apple.com/en-us/HT201300
Exact regex: ^(Mac14,([5679]|10))|MacBookPro1[4-8],[1-4]$
Current or higher regex: Not available
Supported:
Mac14,10
Mac14,9
Mac14,7
Mac14,6
Mac14,5
MacBookPro18,4
MacBookPro18,3
MacBookPro18,2
MacBookPro18,1
MacBookPro17,1
MacBookPro16,4
MacBookPro16,3
MacBookPro16,2
MacBookPro16,1
MacBookPro15,4
MacBookPro15,3
MacBookPro15,2
MacBookPro15,1
MacBookPro14,3
MacBookPro14,2
MacBookPro14,1
Unsupported:
MacBookPro13,3
MacBookPro13,2
MacBookPro13,1
MacBookPro12,1
MacBookPro11,5
MacBookPro11,4
MacBookPro11,3
MacBookPro11,2
MacBookPro11,1
MacBookPro10,2
MacBookPro10,1
MacBookPro9,2
MacBookPro9,1
MacBookPro8,3
MacBookPro8,2
MacBookPro8,1
MacBookPro7,1
MacBookPro6,2
MacBookPro6,1
MacBookPro5,5
MacBookPro5,4
MacBookPro5,3
MacBookPro5,2
MacBookPro5,1
MacBookPro4,1
MacBookPro3,1
MacBookPro2,2
MacBookPro2,1
MacBookPro1,2
MacBookPro1,1
---------------------------------------------------
MacBook Air
https://support.apple.com/en-us/HT201862
Exact regex: ^(Mac14,2)|MacBookAir([89]|10),\d$
Current or higher regex: Not available
Supported:
Mac14,2
MacBookAir10,1
MacBookAir9,1
MacBookAir8,2
MacBookAir8,1
Unsupported:
MacBookAir7,2
MacBookAir7,2
MacBookAir7,1
MacBookAir6,2
MacBookAir6,1
MacBookAir5,2
MacBookAir5,1
MacBookAir4,2
MacBookAir4,1
MacBookAir3,2
MacBookAir3,1
MacBookAir2,1
MacBookAir1,1
---------------------------------------------------
MacBook
https://support.apple.com/en-us/HT201608
Exact regex: ^MacBook10,\d$
Current or higher regex: ^MacBook\d{2,},\d$
Supported:
MacBook10,1
Unsupported:
MacBook9,1
MacBook8,1
MacBook7,1
MacBook6,1
MacBook5,2
MacBook5,1
MacBook4,1
MacBook3,1
MacBook2,1
MacBook1,1
---------------------------------------------------
iMac Pro
https://support.apple.com/en-us/HT210222
Exact regex: ^iMacPro1,\d$
Current or higher regex: ^iMacPro\d+,\d$
Supported:
iMacPro1,1
---------------------------------------------------
iMac
https://support.apple.com/en-us/HT201634
Exact regex: ^iMac(1[89]|2[01]),\d$
Current or higher regex: ^iMac(1[89]|[2-9]\d),\d$
Supported:
iMac21,2
iMac21,1
iMac20,2
iMac20,1
iMac19,2
iMac19,1
iMac18,3
iMac18,2
iMac18,1
Unsupported:
iMac17,1
iMac16,2
iMac16,1
iMac15,1
iMac14,4
iMac14,3
iMac14,2
iMac14,1
iMac13,2
iMac13,1
iMac12,2
iMac12,1
iMac11,3
iMac11,2
iMac11,1
iMac10,1
iMac9,1
iMac8,1
iMac7,1
iMac6,1
iMac5,2
iMac5,1
iMac4,2
iMac4,1
iMac,1
---------------------------------------------------
Mac mini
https://support.apple.com/en-us/HT201894
Exact regex: ^Mac14,(3|12)|Macmini[89],\d$
Current or higher regex: Not available
Supported:
Mac14,3
Mac14,12
Macmini9,1
Macmini8,1
Unsupported:
Macmini7,1
Macmini6,2
Macmini6,1
Macmini5,3
Macmini5,2
Macmini5,1
Macmini4,1
Macmini3,1
Macmini2,1
Macmini1,1
---------------------------------------------------
Mac Studio
https://support.apple.com/en-us/HT213073
Exact regex: ^Mac13,\d$
Current or higher regex: Not available
Supported:
Mac13,2
Mac13,1
---------------------------------------------------
Mac Pro
https://support.apple.com/en-us/HT202888
Exact regex: ^MacPro7,\d$
Current or higher regex: ^MacPro[7-9],\d$
Supported:
MacPro7,1
Unsupported:
MacPro6,1
MacPro5,1
MacPro4,1
MacPro3,1
MacPro2,1
MacPro1,1
@grahampugh
Copy link

Suggestion: add VirtualMac\d,\d.

@talkingmoose
Copy link
Author

talkingmoose commented Feb 10, 2023

Suggestion: add VirtualMac\d,\d.

Hey @grahampugh! Can you point me to any documentation for this? It’s not on Apple’s pages listing model identifiers that I’ve found.

@grahampugh
Copy link

Best I can find quickly is https://derflounder.wordpress.com/2022/11/17/downloading-macos-ipsw-files-for-use-with-mac-virtual-machines-on-apple-silicon-macs/

Every VM on Apple Silicon has this type of model identifier. I found that if I don't include it in my reflex, I'm getting spurious results in my incompatibility smart groups.

@atlauren
Copy link

Suggestion: While the regexes already cover them, add text for the 2023 models:

Mac Mini (2023):
Mac14,3
Mac14,12

Mac Pro (2023):
Mac14,8

Mac Studio (2023):
Mac14,13
Mac14,14

MacBook Air (2023):
Mac14,2
Mac14,15

MacBook Pro (2023):
Mac14,5
Mac14,9
Mac14,6
Mac14,10

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