Wrong result with a smartgroup using a regex

Spillou
Contributor

Hello !

I made a smartgroup for macOS greater or equal to 15 Sequoia. It should be simple:

Criteria: Operating System
Operator: matches regex
Value: ^1[5-9]

I have NO computer running Sequoia, but I have 3 results. 3 Intel computers with macOS version 10.14.6 (2 of them) and 10.15.7 for the last one.

I searched all around and can't find where is the problem. I'm not really used with regex, but this one should be simple.

Any help is welcome

1 ACCEPTED SOLUTION

karthikeyan_mac
Valued Contributor

Hi @Spillou,

Any specific reason you wanted to use regex? We use  criteria Operating System Version greater than or equal to 15 and it works. 

The wrong results can be a bug. I used the regex as yours and notice there are few macOS 10.15.7 devices included in the scope. 

Thanks

Screenshot 2025-02-17 at 15.10.31.png

 

View solution in original post

5 REPLIES 5

karthikeyan_mac
Valued Contributor

Hi @Spillou,

Any specific reason you wanted to use regex? We use  criteria Operating System Version greater than or equal to 15 and it works. 

The wrong results can be a bug. I used the regex as yours and notice there are few macOS 10.15.7 devices included in the scope. 

Thanks

Screenshot 2025-02-17 at 15.10.31.png

 

Spillou
Contributor

Well, I wanted to find a way for my policies and profiles to apply on specific operating systems and not on those I couldn't check the compatibility. This way, I just have to change the regex in my smartgroup. Easy to do. Maybe the way you describe should be good enough, using the OS version and greather or equal / lower than.

I forgot to mention that I have smartgroups for the macOS versions using regex like ^14 or ^15 and they work perfectly. Juste the one with the brackets that shows a wrong result.

sdagley
Esteemed Contributor II

If you're looking to use a regex to check against a minimum version number in a Smart Group I'd strongly recommend taking a look at https://github.com/moorereason/make_ge_version_regex to simplify creation of them.

Shyamsundar
Contributor III

try with this  ^15(\.\d+(\.\d+)?)?$

Spillou
Contributor

@Shyamsundar Thank you for your solution, but it will be only for macOS 15, not 15 and above. karthikeyan_mac's solution is better for what I wanted to do. Maybe I should consider another approach, a little more constraining but more cautious.