Create smart labels by parsing computer name. Use regex?

As many of you probably do, we create our computer names using a combination of location, employee role, and computer number. I want to create smart labels that just looks at the middle part of the name. Our computer name is like this: ABCD1234YZ. Where 1234 is the part I want the smart label to look at. There’s always the same number of characters in each of the sections. 4 characters in ABCD. 4 characters in 1234. 2 characters in YZ.

The ABCD section has 15 different variations and more that will get created soon. Needless to say, it would be pointless and tedious to add a line to the smart label to account for each of those 15 variations. I’m wondering if there’s a way for the smart label to basically ignore the ABCD section of the computer name and only look at the 1234 part. I’m imagining something like this.

-          First smart label: Computer Names that match “####1234##”

-          Second smart label: Computer Names that match “####5678##”

-          Third smart label: Computer Names that match “####9012##”

My assumption is that this might be possible using some regex hocus-pocus. I’m just not familiar enough with regex. Any ideas?

2 Comments   [ + ] Show comments
  • You could use system name like %1234%
    or with a regex
    Ssystem name match regex ^.{4}1234.{2} - flip1001 1 year ago
    • Yep, no need for regex, just use the wildcard. - chucksteel 1 year ago
      • By wildcard, do you mean the percent sign (%) like above or the asterisk (*)? I think I tried the asterisk and it didn't work. - Troubleshooter5000 1 year ago
      • In SQL the wildcard character is the percent sign and not the asterisk. - chucksteel 1 year ago
  • I think I was confusing myself between the actual SQL code and the web interface.

    You can use System Name Contains 1234 - flip1001 1 year ago

Answers (0)

Be the first to answer this question

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