Regex with Application Version (MS Office)

micmil
New Contributor III

I am struggling real hard trying to parse out computers with different versions of Microsoft Office. I am using the attached search as a test. Every time I run this search it pulls the wrong info in two ways:
1. It returns all versions of Excel.
2. It returns any app with a matching version number.

794e1d545aac4685992223c322f067d6

I am using the solution from this post, which is similar to other supposed solutions on the board.

2 REPLIES 2

SmilieK
New Contributor III

if you're trying to bring everyone to a current version of MS, look at @talkingmoose's Regex Current Version or Higher Script to get the perfect Regex. At least it saves me so much time. You might be able to get it to work in other ways also.

https://gist.github.com/talkingmoose/2cf20236e665fcd7ec41311d50c89c0e

Just open terminal and sh /path/to/script/<scriptName>.sh 1.23.4 it will spit out how the final Regex was created, then just pop that in Jamf and select "Does not match Regex." to find all older versions below what you are looking for.

micmil
New Contributor III

I don't think the regex is the problem. The search is reporting all installed apps within that version range, PLUS all installed versions of Excel. It's treating the search criteria as an OR search instead of an AND search:
Find all versions of 'Microsoft Excel'
OR
Find all application titles with a version 'from 16.17 to 16.99'

I tried the above regex at https://regex101.com/, which seems to be matching the correct version numbers. I also tried the script your linked, which shot out this:

^(d{3,}.*|[2-9]d{1,}.*|1[7-9].*|16.d{3,}.*|16.[2-9]d{1,}.*|16.1[8-9].*|16.17.*)$

Which also passed the test at regex101.

Just for giggles, I tried flipping the search to OR, which did change the output. It was still reporting the wrong information, however. I'm starting to think this is a bug.