How to apply Regex to saved PDF email

Hello

I need some assistance in applying Regex to a saved PDF of an email.

My process is as follows which I am trying to automate:

  1. Open inbox and PDF the email to designated folder.
  2. Open PDF of email and Scrape.
  3. Apply regex to Scraped Data and capture variables (name, email, comments) and enter into Database.
  4. Once captured in database, assign item to static team and save.
  5. Restart process until queue empty.

I am comfortable with most elements of process (so far) and how to do them in UiPath.

The part that I am having trouble is how do I apply regex to capture these variables from a Scraped PDF.
(here is a link to my previous forum post Extracting field data from an email using Regex - #2 by aksh1yadav)

I have found a few posts in the forum but none seem to work in my situation.

I would appreciate some assistance with:

  1. How do I apply this regex expression ‘(?<=name :).*(?=\n)’ to a data scrape variable? (Which activities etc)
  2. Converting the output to a string variable to be entered into a text field.

I am new to regex and thanks to everyone’s assistance in my last post :slight_smile:
I found this video helpful to gain a better understanding of Regex plus Regex101 is great.

Any assistance would be greatly appreciated.

Steve

Hi @Steven_McKeering,

Simply use “Matches” activity in UiPath for this. Check the attached workflow on how to use “Matches” activity.
Main.xaml (4.9 KB)

Follow the link for more info.

Regards,
Tharusha

2 Likes

Hi @Tharusha_Jayadeera

Thank you for the response. This really helped me out.

Your attached workflow was especially helpful. I have been able to successfully apply this!

Regards
Steven

2 Likes

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