cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Trouble with some RegEx in a customer parser

Jump to solution

I've been tasked with creating a set of custom parsers for one of our in house applications.  At this point, I am about 85% to 90% of the way there for capturing all of our event types.  Our applications/dev team has created a field where the output that i've set as a capturing group comes up in one of two ways.

ClientId:00000000-0000-0000-0000-000000000000

or

ClientId:NULL

The second one is simple enough as I can capture that with a simple (?:\w+)(\w+)

The first one is kicking me in the rear.  Obviously it fails the regex used for the second pattern, but if I write out the pattern explicitly enough to capture the first patter of the zeroes and dashes, I then not get the second pattern.  What i'm looking for is a set of expression that is truly accepting of random variable, regardless of their content.  I've tried left to right boundaries and anchors, but I am getting no where.

Let me also mention that I am an extreme newbie in RegEx and essentially had to teach myself the basics in a day.  So any help here I could get would be MAJORLY appreciated!

Thanks in Advance,

Tim

1 Solution

Accepted Solutions
Highlighted

Re: Trouble with some RegEx in a customer parser

Jump to solution

Kind of ugly but this worked in my quick testing:

(ClientId)(:)(.+?(?=$))

This will match ClientId, the colon and then the rest of the string until the end of the line

View solution in original post

2 Replies
Highlighted

Re: Trouble with some RegEx in a customer parser

Jump to solution

Kind of ugly but this worked in my quick testing:

(ClientId)(:)(.+?(?=$))

This will match ClientId, the colon and then the rest of the string until the end of the line

View solution in original post

Highlighted

Re: Trouble with some RegEx in a customer parser

Jump to solution

Anton,

Thank you so much!  That exactly did the trick! 

Tim

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community