Need regex expression to scrape particular data from e mail body

@Aleem_Khan,

Use this expression : ((?<=Project Contact\(s\):)\n[\w\W]+(?=\n\s))

Also, if you are satisfied and got the required solution, kindly mark it as a solution that would be helpful for others for further reference.

Thanks,
@90s_Developer

Not detect the value.

@Aleem_Khan,

Please refer to the below screenshot for better reference.

Please try this expression in Regex101

Thanks,
@90s_Developer

Sorry for that but its not match for me :frowning:

@Aleem_Khan ,

I have tried and able to achieve the expression value in the same site which you’re working. Please refer to the below screenshot.

Expression : ((?<=Project Contact\(s\):)\n[\w\W]+(?=\n\s))

Thanks,
@90s_Developer

[quote=“90s_Developer, post:13, topic:391597”]
((?<=Project Contact(s):)\n[\w\W]+(?=\n\s))
[/qu
I do not know why its not working for me

@Aleem_Khan ,

Kindly check the expression, the expression which you are implementing is wrong!

Please find below text file for your reference.

Expression.txt (60 Bytes)

You’re missing the \ before and after of s present in the Project Contact(s)

Thanks,
@90s_Developer

I tried this: ((?<=Project Contact(s):)\n[\w\W]+(?=\n\s)) still not working

@Aleem_Khan,

I have used the same website for performing the regex.

In that case, can you implement it in the website and share the screenshot of your expression. It would be better understanding to find the issue.

Thanks,
@90s_Developer

Guys, the reason you are both disagreeing is because UiPath uses a certain kind of RegEx. NET variant. Read more here: .NET Regular Expressions Documentation here from Microsoft.

You have to use RegEx Storm to test queries. But be careful and don’t submit PII. It is HTTP only.

1 Like

@Aleem_Khan,

Hope you would have executed the expression which I have given in the previous reply.

If your issue is solved, kindly mark it as a solution that would be helpful to others for further reference, and also the query will get closed.

Regards,
@90s_Developer

Hi
Thank you so much and really appreciate but this solution still not work for me
I use this ".*@[\w.]+ " but the problem I am facing I did not get complete e mail id’s
sometime it get one and some time all can you help me to make this solution more reliable.

@Aleem_Khan ,

Follow these steps,

Use Matches activity, and select RegEx as Email.

This will fetch all the email addresses present in that string.

image

kindly mark it as a solution that would be helpful to others for further reference, and also the query will get closed.

Regards,
@90s_Developer

Hi @Aleem_Khan,

Can you update me regarding this query?

If your issue is solved, kindly mark it as a solution that would be helpful to others for further reference, and also the query will get closed.

Regards,
@90s_Developer

HI @Aleem_Khan

For Example 1:
regex101: build, test, and debug regex

For Example 2:
regex101: build, test, and debug regex

You need to use split(RegexVarible,Environment.NewLine) to store all the emails in the array and you can use them by looping or incrementing.

For Example 3:

Can you send any constant word that is right below the table?
I will send you the expression

Hope this helps

Regards
Sudharsan

2 Likes

An also send the example 3 table as text format with the exact format of space by setting preserve format as true in read PDF text and use write test file and copy the table part and send here

Regards
Sudharsan

First try to separate the whole table as separate string like this

And use the following regex to get the table values

Note: You need to choose regex option as insensitive in matches activity if you use matches activity

if you use expression you need to give " ,Regexoption.insensitive "after the pattern

For splitting and saving in excel follow the steps or workflow in this thread

Hope this Helps

Regards
Sudharsan

Thank you so much for your effort I really appreciate I use email extraction to fetch email id from email body

Hi @Aleem_Khan,

If your issue is solved based on the solutions which were given in the above replies by us, kindly mark it as a solution to close this query else it would be in the active state until it mark as a solution to any one of the replies.

Regards,
@90s_Developer

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