Is it possible to use Regex in a Group or AppliesTo filter?

  • 21 September 2023
  • 3 replies

Userlevel 5
Badge +6


I need to filter a specific number of machines into a group or datasource.  The filter is any machine that has the letter ‘c’ as the second-to-last character before the first period in a name.  E.g.

I have some Regex that will do this ( [^.]*c[^.]\.[^.]*\.[^.] ), but when I try to use it in an AppliesTo it just fails.

According to this page:  I should be able to use =~ or !~ but they both give errors like this:


I tried putting it in quotes, parenthesis, quotes and parenthesis, and I couldn’t get it to work.  I opened a ticket and they are going to look into it, but I thought I’d post here in case anyone knew if this is possible or not and how to make it work.



Best answer by Amr Abdelrahman 21 September 2023, 16:34

View original

3 replies

Userlevel 4
Badge +7

Hi Kelemvor, 

The dots that need to be used as literal characters need to be escaped with \\, for your example its the dots outside the square brackets. Can you try the below?


Relevant mention in the AppliesTo article 

Userlevel 5
Badge +6

Sweet.  Thanks!  Had to add the extra \’s and then put the whole thing in quotes, and it’s working.

Userlevel 4
Badge +7

Awesome, I’m glad it worked! 🙌