Skip to main content
Solved

Wrong result with a smartgroup using a regex


Spillou
Forum|alt.badge.img+5

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

Best answer by karthikeyan_mac

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

 

View original
Did this topic help you find an answer to your question?

5 replies

karthikeyan_mac
Forum|alt.badge.img+17
  • Honored Contributor
  • 281 replies
  • Answer
  • February 17, 2025

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

 


Spillou
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • February 17, 2025

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
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3536 replies
  • February 17, 2025

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
Forum|alt.badge.img+13
  • Jamf Heroes
  • 286 replies
  • February 17, 2025

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


Spillou
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 30 replies
  • February 18, 2025

@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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings