Search for string in Email Subject

Hi guys,

i’m looping through email messages and if I found the one that contains “TEST-”& any numbers in Subject I have search the body. So for example “TEST-15345” or “Test15”.

in this moment it looks like this:

image

Should I use regex here? How?

Best Regards,
M

@Marek_Matuszak

You can write expression as below

mail.Subject.Contains(“TEST-15345”) OR mail.Subject.Contains(“Test15”)

If you have doubt about the Casing of letter then

mail.Subject.Toupper.Contains(“TEST-15345”) OR mail.Subject.ToUpper.Contains(“TEST15”)

Hope this helps you

Thanks

Yes, but that could be any number, like (“TEST-15”), (“TEST-15345”), (“TEST-99999”). I need “TEST”+“-”+any digits.

@Marek_Matuszak

Then use Regex as below
image

Hope this helps you

Thanks

Yes it helps, but I dont know how to implement it.

I have to do sth like this. If this subject contains Test-digits then I go to then in if statement. I need like boolean from this.

@Marek_Matuszak

Use ISMatch Activity, you can get the boolean value whether it is matched or not

Give Input as mail.subject.ToUpper
pattern-> (?<=TEST).+\d
Result-> You will test as a boolean

Hope this helps you

Thanks

1 Like