Its that time of year again!
I've modified my regex statement to take out the models that were tragically lost this year to the latest macOS version. RIP 2017 MacBook Pro and iMacs.
I've also added in some bug fixes, mainly that it wasn't matching the full line if the last number after the comma in the model identifier was a double digit (as Apple added one this year for the first time), and gave myself some wiggle room in all the other models in case Apple continues to add more double digit identifiers down the line:
As done previously, you can create a smart group using this in order to find devices in your environment that are not compatible to be upgraded to macOS Sonoma by using the criteria item Model Identifier and then selecting "does not match regex" operator. Copy/paste the regex into the value and save the Smart Group to view all mac's that ARE NOT compatible with Sonoma, or set the operator to "matches regex" to see devices that ARE compatible.
Once I have one of the newer MacBook Air and Pro models and/or Apple has added their identifiers to their documentation, I'll confirm that the regex still works or update as necessary.
FWIW setting the model to not match the regex in this thread identified three more types of devices than setting the model to match the regex from this thread:
MacBookPro14,2, MacBookAir6,2 and MacBookAir7,2
Your mileage may vary, but be advised, if you've got 99 problems and you think you can solve them with regex, well, now you've got 100 problems.
It's a good idea to add compatibility for Virtual Machines if there's likely to be any in your environment. Apple Silicon VMs have their own identifier, so you have to add that.
Here's our compatibility regex for Sonoma: