Help with String match

Hi,

I struggel since hour with a Problem, which is may for an Expert easy to solve.
I’ve an Activitie that scrapes a String from a System and I want to extract the Name out of the string.
The string has two diffrent syntaxes and I don’t find out how to solve it with one RegEx

Option 1
(Name of Company [Name of Agent])
I use this RegEx (?s)(?i)(?<=])(.*?)(?=]) to parse

Option 2
(Name of Company [Prefix] [Name of Agent])
I use this RegEx (?s)(?i)(?<=] [)(.*?)(?=]) to parse

In both Options I only want to have the name of the Agent. How could I merge both RegEx into One.

Thx for your support.

BR

Bille

Hi,

I suppose you can get the Name of Agent using Replace Activity with the following settings.

Pattern : ".*\[(.*?)\]\)$"

Replacement : “$1”

The result will be only the Name of Agent.

Regards,

Thx, it works.

1 Like

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