Computer assignment problem on role tab (with regex relevance)

Hi all,

I think there is a problem with “computer assigment” tab (under Roles) if i use regex relevance on retrieved properties . my custom retrived properties works fine on tasks,grouping or etc. But if I use it on “computer assignment” it won’t work. (Roles does not have computers. with regex relevance)

this is not working ;

(if (computer name starts with "A****") then "XXX" 
else if (computer name starts with "I***") then "BIGFIX"
else if (exists matches (regex "^[a-z]\d{4}z\d{2}-*") of (computer name as lowercase)) then "BBB"
else if (exists matches (regex "^[a-z]\d{4}p\d{2}-*") of (computer name as lowercase)) then "CCC" 
else "N/A")

this is working ;

    if (computer name starts with "A****") then "XXX" 
    else if (computer name starts with "I****") then "BIGFIX"
    else "N/A"

Check the thread at Digit \d matching in regex

The regex matching uses OS libraries and varies by system. Safest to use only POSIX-compliant expressions. Good links in that thread, but basically \d should instead be [[:digit:]] and \w should instead use [[:word:]]

1 Like

i tried it with [[:digit:]] but it didn’t work. (By the way we don’t have any aix client on our enviroment)

Can you post the regular expression, and a hostname that you expect to match it?

for example;
If the PC name starts with IEM I hope to see it in the BIGFIX group.

(if (computer name starts with "A****") then "XXX" 
else if (computer name starts with "IEM") then "BIGFIX"
else if (exists matches (regex "^[a-z]\d{4}z\d{2}-*") of (computer name as lowercase)) then "BBB"
else if (exists matches (regex "^[a-z]\d{4}p\d{2}-*") of (computer name as lowercase)) then "CCC" 
else "N/A")

this relevance is working for under computers/Retrieved Properties (/d or [[:digit:]] it doesnt matter).
But if i use this “retrieved property” on Roles/Computer Assigments , it is not working. I can’t see any computers in assigned role.

You can see from screen shots. Please check computer number on second screenhot. (screen shots from my test enviroment. In production i have same problem for 20k client)

if i use retrive property without regex, role-computer match is working.

image

Hello Jason ,

I have to correct my previous comment. If i choose BBB or N/A group, role doesn’t have any computer. Roles doesn’t recognize regex block.

(if (computer name starts with "A****") then "XXX" 
else if (computer name starts with "IEM") then "BIGFIX"
else if (exists matches (regex "^[a-z]\d{4}z\d{2}-*") of (computer name as lowercase)) then "BBB"
else if (exists matches (regex "^[a-z]\d{4}p\d{2}-*") of (computer name as lowercase)) then "CCC" 
else "N/A")

Sorry, I’m still waiting for a list of computernames that you expect to match your regex.

else if (exists matches (regex "^[a-z]\d{4}z\d{2}-*") of (computer name as lowercase)) then "BBB"

for example this part of regex i expect ADDDDZDD (D is digit ) computer names in BBB group. I see all "ADDDDZDD " computer names in BBB property. It is ok but in role segment i see 0 computers if i give BBB group. Is that clear ?

What’s that hypen in your regex for, after the last d{2} and before * ? That implies it must end with some number of hyphens --. Should that have been a dot ·* ?
(Aside: typing regex on a phone is no fun)

we have some computer names like ADDDDZDD-D but most pc names like ADDDDZDD.

Hello Jason ,

I opened a case for this situtation . Their advice is “^[a-z]\d\d\d\dz\d\d” for regex. After using “^[a-z]\d\d\d\dz\d\d” , my problem solved. Problem is related with curly braces.

1 Like