/build/static/layout/Breadcrumb_cap_w.png

KACE: Matches REGEX 101

Matches REGEX 101

Today I will be showing how "matches REGEX" works and how it can help you in creating more robust Smart Labels.

Matches REGEX is an arguement that requires proper syntax to work correctly.  There are certain fields in the Smart Label wizard that will allow you to use this arguement.

Here is an example of a Patch Label I created for my environment to narrow down the patches I download to my KBOX through my subscription settings.

(Note:  The syntax requires you to put a "|" between each word/value you want to search for.)

This Query is looking in the patch database for any patches that match the following criteria:

Title=Flash or Reader or Java or Shockwave or Acrobat AND

Impact = Critical AND

Patch Type = OS AND

Language = English

This enables me to create one smart label to patch all my web friendly applications and frees up disk space!

(Note:  If you limit your patch downloads via Smart Labels only the patches listed in the Smart Labels AND the OS settings you have chosen will be downloaded.)

 Check out those results!!


{For those learning SQL}

Here is the query in code:

[

select UID from KBSYS.PATCHLINK_PATCH where ((((  KBSYS.PATCHLINK_PATCH.TITLE rlike 'Flash|Reader|Java|Shockwave|Acrobat') AND KBSYS.PATCHLINK_PATCH.IMPACTID = 'Critical') AND KBSYS.PATCHLINK_PATCH.IS_APP = '1') AND (1  in (select 1 from KBSYS.PATCHLINK_PACKAGE, KBSYS.PATCHLINK_PACKAGE_LANGUAGE_JT where PATCHLINK_PATCH.UID = PATCHLINK_PACKAGE.PATCHUID and PATCHLINK_PACKAGE_LANGUAGE_JT.FILENAME = PATCHLINK_PACKAGE.FILENAME and KBSYS.PATCHLINK_PACKAGE_LANGUAGE_JT.LANGUAGE_ID in (1,255,0) )) )

]

If this helps you please rate it!

Have a Happy New Year everyone!!

 


Comments

  • Hello,


    thanks for posting it!
    It is possible to find more information about the regular expressions here:
    http://dev.mysql.com/doc/refman/5.1/en/regexp.html
    and
    http://www.regexlib.com/
    Regards,
    StockTrader - StockTrader 11 years ago
  • Excellent post! I'm already finding it useful. - GeekSoldier 11 years ago
  • Cool google tool for finding an IP range using regex.

    http://support.google.com/analytics/bin/answer.py?hl=en&answer=1034771 - jdornan 11 years ago
  • Thank you Stock|Geek Soldier|Jdornan! :) - c_brock 11 years ago
  • Hi c_brock,
    I have struggled with REGEX, but this makes it SO SIMPLE! Thank you for clarifying how to use it to great advantage!

    -awingren - awingren 11 years ago
  • I keep coming back to this post. It has simplified how I make some of my smart labels. I used to have to layer labels to get the same results. Very helpful! - GeekSoldier 11 years ago
  • Thank you so much for all the positive comments. I am glad I could help!! :) - c_brock 11 years ago
  • I also come back to this post over and over! It's a huge time-saver!
    This post is the top of google search results when your search string is:

    site:itninja.com regex - awingren 11 years ago
  • I still reference this article! Thank you, c_brock!
    =D - awingren 10 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ