Regex string

Hello everyone,

I’m trying to export a certain string from an email subject:

Examples:
INPUT: “TEST1 BBE REQUEST”
OUTPUT: “BBE”
INPUT: “TEST2 BBE-BLU CHANGE REQUEST”
OUTPUT: “BBE-BLU”

The output can be ABC or ABC-ABC.

I tested a regex syntax in the online builder and it works: \b([A-Z]{3})\s|(\b([A-Z]{3}-[A-Z]{3})\b)

Whenever I use it in UiPath it doesn’t work:
System.Text.RegularExpressions.Regex.Match(Subject,“\b([A-Z]{3})\s|(\b([A-Z]{3}-[A-Z]{3})\b)”).ToString

Hi,

Your pattern seems correct and it works in my environment.

Can you check the following sample?

Sequence2.xaml (5.7 KB)

Regards,

Thank you.
I don’t know why but I had to create a separate activity for it and export it as a workflow in order to make it work.

Thanks!

1 Like

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