What Flavor of RegEx?

adroitus
New Contributor II

Does anyone know what flavor of regex is used by Jamf Pro? I've been using PCRE for my patterns, and haven't had any problems (that I know of,) but would like to get official confirmation just to be sure.

Mac user since 1988.
1 ACCEPTED SOLUTION

talkingmoose
Moderator
Moderator

From past research, I've discovered we're using the Java regex engine and in developer notes I've read, they were using https://www.freeformatter.com/java-regex-tester.html for testing and validation.

And thank you, @shaquir, for the kind words!

View solution in original post

6 REPLIES 6

shaquir
Contributor III

Hi @adroitus ,
I'm not sure, but @talkingmoose may have the specifics. He has a fantastic Regex script on his Github Match Version Number or Higher.bash.

talkingmoose
Moderator
Moderator

From past research, I've discovered we're using the Java regex engine and in developer notes I've read, they were using https://www.freeformatter.com/java-regex-tester.html for testing and validation.

And thank you, @shaquir, for the kind words!

L-plateAdmin
Contributor

Will second the use of the free formatter tool as we needed to make a regex to match a bunch of Minis via serial number in two places to exclude some build items for a specific project.

its a shame that the its all binary regex generator that works from plain text which at least gave me a start being having to force my head around it when it wasn't the right type of regex, no idea which one it is

adroitus
New Contributor II

Thank you for that, @talkingmoose. I'll start using the Java flavor from now on. I've been using the one at Regular Expressions 101. It allows you to choose your flavor, and save and share your patterns, which is nice since I do iterations of a few patterns.

Mac user since 1988.

howie_isaacks
Valued Contributor II

I am totally clueless about how to use regex. If I wanted to express an application version number as regex, how would I convert it? I am being asked to use that method instead of simply putting in the version number and selecting one of the options in the drop-down in smart group criteria such as is, is not, etc. I am supposed to use the matches regex option. I have no idea how to take an app version number and convert it to regex. I have seen regex for Mac hardware models. I don't know how to take that list of hardware models and convert it to regex. The tool linked above is completely incomprehensible to me. I don't consider myself to be a dummy but I guess I am where this is concerned 🤷🏻‍

There’s no reason to use regex to match a string that’s unique like a specific version number like just “10.41". You’d only use regex to match multiple possible strings like “10.41”, “10.42” or “10.43”. That would look like:

10.4[1-3]

Not sure what you’re needing to match, but I do have a script to create a regex to match a specific version number or higher: Match Version Number or Higher.bash.