How to check if a string has a certain pattern?

Hello,

I need to check for a certain string variable if it verifies the pattern: Word Hello + Digits + Email account:

String 1 -> “Hello 4938 example@example.com” Yes
String 2 -> “Hello example@example.com” No
String 3 -> “434 example@example.com” No

Thank you.

@username_uipath
the email pattern is done in a quick and dirty way:
grafik

Hello \d+ \b.*@.*\b

1 Like

Thank you. How can I get them once I verified the pattern is correct?

I mean how can I get the Digits and the Email?

Thank you.

@username_uipath
go for this pattern
grafik

and use it within an isMatch activity are Regex.IsMatch statement

if the string is matching then extract the values with the help of Match activity or Regex.Match statement
refer to the groups and extract the different values:
grafik

have a play on https://regex101.com/

also have a look here:

2 Likes