Regular Expression Capture ID

I need a regular expression that captures just the ID “Z*TESTID” without the <.

The text its looking in will look like this:

If you’re already logged in with <Z*TESTID (Job Role-based ID)>, pass this step. Otherwise:

  1. Logout and completely close out of all Edge browser tabs for the profile you’re using for testing.

  2. Open your testing Edge browser profile and log back in with <Z*TESTID> (replace * with your

Hello @kasey.betts

Please find below a regex pattern and expression to capture the first match.
Regex Pattern preview

Use the following in an Assign activity:
System.Text.RegularExpressions.Regex.Match(yourStr, “(?<=<)[^\s\>]+”).ToString

Check out my Regex MegaPost to learn more

Cheers

Steve

@Steven_McKeering what do I change to make it capture any ID beginning with “Z”?

I need to get just the letters. It may be in any of the formats below

{Z*TestID}
ZMHjjj
[ZDTestID]

In all of those scenarios I would need everything after Z until a space or the next word.

not including the brackets…however there won’t always be brackets

Hello

Glad I could help you :blush:

You just need to add a “Z” before the first Square Bracket [

Like this:


Test your pattens/text here

Let me explain this pattern:
Must have a “<” to start the pattern (but wont capture this in the match.
Must have a “Z” to begin the match.
Will match ALL text until it reaches a space (“\s”) or a “>”

Hopefully this helps

Cheers

Steve

It may not always have the <. It might just say “the ID is ZMHGG” and I would still need to capture that Z ID.

Hello

Try this pattern instead

Hopefully you got it now :blush:

Cheers

Steve

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.