How can I extract multiple items from a body of an email text?

Hello!
I have a ‘Watch Emails’ module set up and I am trying to extract multiple fields from the body of text.

Date and Time:
Duration:
Meeting Link:
Contact Info:
I’m using this regex: Date and Time:\s*(.+?)\sDuration:\s(.+?)\sMeeting Link:\s(https?://\S+).?Contact Name:\s(.+?)\sContact Email:\s(.+?)\sContact Phone:\s(\S+)

but i’m not getting any output bundle.
I’ll be happy if anyone could help
Thank you very much in advance.

1 Like

Hi @Stt
Could you share an output bundle of watch module. So that we could further assist you.

Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation

Hi @Stt

If the content is in key value pair. you can use the text parser “Match element” module.


Output:

Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation

Hello @Stt,

Welcome to the community.
I hope the suggestion from @Msquare_Automation works for you.

If not then I recommend you to check this long discussion on this topic which is related to your question. It will give you more ideas to take care of multiple things.

I hope this helps. :+1:



when i tried with key:value pair the output bundle gives no value as the key in links, see in meeting location and the value is considered new key, i guess because of https

thankyou @dilipborad I’ll go through it

@dilipborad I checked the article but still I couldn’t figure out what I’m doing wrong

Hello @Stt,
Try to use this new updated RegExp with a text parser.

Date and Time:\s+(?<date_time>.*?)(\n|\\n)Duration:\s+(?<duration>.*?)(\n|\\n)Meeting Link:\s+(?<meeting_link>.*?)(\n|\\n)Contact Info:\s+(?<contact_info>.*?)$

I’ve updated it based on your given string.
Note: The only concern is your content string ends with that Contact Info. If there is more content then you need to share the full content string and I’ll rewrite the expression for you.

See the Proof of Regular Expression regex101: build, test, and debug regex

I hope this works.
:+1: