Extract lines of text from emails

Hello there, wonderful community!

Quick question for you. I would like to extract the Page ID from emails that will be received in the following format:

You have a new website form submission:

  1. Where would you like to promote your listing?
    Sitewide
  2. Consent
    checked
  3. User Email
    info@domainname.com
  4. Page ID
    39918
  5. Request submitted from page
    https:// domainname.com/category/funding/business-funding/

I’ve read through a few posts and watched an informative video found here Split text . This post seems to match what I’m trying to accomplish, however, the steps didn’t work for me.

If anyone minds assisting with this challenge, it would be greatly appreciated.

Take care

Hello @Testingdip,

I would suggest a Text parser Match Pattern module.
Get some AI help to create and adjust a regular expression.

Here’s an example of how the results look from your example input:

Here’s how that module would be configured, enabling Global Match is the only difference from its defaults.

Here’s the regular expression (might need adjustment to be more flexible):
1\.\s*Where would you like to promote your listing\?\s*(.*?)\s*2\.\s*Consent\s*(.*?)\s*3\.\s*User Email\s*([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})\s*4\.\s*Page ID\s*(\d+)\s*5\.\s*Request submitted from page\s*(https?:\/\/\s*\S+)

I appreciate your help @Donald_Mitchell. This worked for me.

Take care.

1 Like