Need Regex Help Please

Hello

I am super new to regex and im trying to nail down 2 separate regular expressions.

I need a regex that will extract everything after the words “description=”

  1. Test field is:

description=Account Locked Out

For the 2nd one, I need to extract everything after the words "Client Computer : "

  1. Test field is:

Client Computer : XYZ1234

Can someone please be so kind as to help a newbie out with these 2 expressions?

Thank you

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

Randell

I meant anything after the “=” sign.

So description=Account locked out. I would want to capture anything after the “description=” part of the string. But stop at the end, as its part of a payload. The interesting part is that right after the part im trying to capture, there is a “CN=” value that could be used to perhaps end the regex.

This is for Java script by the way

Thanks

If you haven’t discovered it yet, regex101.com is my absolute favorite tool for working out a regular expression.

1 Like