I need a regex to find A subject of a e-mail

i need a regex to find a subject of an e-mail and search on amazon: “Livro – ID xxxxx”
the text

can you try this regex: [Livro]+ – [ID]+ [0-9]{5}+

HI @Cleiton_Elias_dos_Santos

Welcome to UiPath community

You can try with this regex expression

System.Text.RegularExpressions.Regex.Match(YourString,"(Livro\s+\W\s+\S+\s+\d{0,5})").Tostring

Regards
Gokul

But when i print the result, he just show false or true.

but how he just show me true or false

Hi @Cleiton_Elias_dos_Santos,

I tried @Gokul001’s regex and it seems ok to me.

If you want to see the subject is appropriate or not you need to use below screenshot’s assign.

Kind Regards

When i try to catch a match in e-mail, he don’t catch any e-mail id

I can’t understand your requirement @Cleiton_Elias_dos_Santos

Have you tried with above regex expression?

Can you share of the Subject of the email?

Regards
Gokul

@Cleiton_Elias_dos_Santos
To extract Mail ID from Text, use this
[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+

System.Text.RegularExpressions.Regex.Match(YourString,"[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+").Tostring

Share the input and Output here. @Cleiton_Elias_dos_Santos

In the subject of the e-mail, contais a ID and a i need to extract that id, but the uipath do not return to me any data.

share the workflow @Cleiton_Elias_dos_Santos

Can you share the regex expression here @Cleiton_Elias_dos_Santos

Share the Input subject here

regex expression is System.Text.RegularExpressions.Regex.Match(“Livro ID - 12345”,“[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+”).Tostring

and the subject is it
image

Your Regex expression is wrong @Cleiton_Elias_dos_Santos

Try with this regex expression

System.Text.RegularExpressions.Regex.Match(item.Subject,"(?<=Livro\s\W\sID\s)(\d+)").Tostring

image

Regards
Gokul

Now works, ty very much.

Great @Cleiton_Elias_dos_Santos

Kindly close this topic by mark as solved. It will help for other too.

Regards
Gokul