Read email using Regex (regular expression)

I have this field in all my file, I’m trying to get the email address after the fixed text: (see below)

VERIFY SHIP DATE & PRICING TO
FIRSTNAME.LASTNAME@COMPANY.COMPANYST. COM

2 examples:

** P.O. MEMO **
<150LBS SHIP UPS GRD# 1345666

ABCDEFG 0099
WWW.COMPANY.COM/TRACKINGGUIDE
NO DECLARED VALUE
VERIFY SHIP DATE & PRICING TO
FIRSTNAME.LASTNAME@COMPANY.COMPANYST. COM

Sometimes when the email is too long it will be split into 2 lines like below

FIRSTNAME.LASTNAME@COMPANY.COMPANY
ST. COM

How to get the address of this memo field using regex Matches activity?

Hey @zkk

Welcome to the UiPath Community Forums :partying_face:

I note there is a space (" ") before the “COM”. Like this “. COM”. I have assumed this is a typo.

Can you provide some de-identified samples?

In the meantime I have created a pattern which may assist you. Take a look here:
Sample #1 Link
Sample #2 Link

Hopefully this is a start.

Cheers

Steve

2 Likes

Thank you Steve! I’m wondering if this will work if there’s additional text after the email address?

this is a sample

ABABABAB A222 CCCCCC
ADDRESS FIELD
SERIAL # 1234567899
NAME@ADDRESS1234.COM

** P.O. MEMO **
<150LBS SHIP UPS GRD# 60RDF6

150LBS VIA COMPANY POLICY
WWW.COMPANNY. COM/TRACKINGGUIDE
NO DECLARED VALUE
VERIFY SHIP DATE & PRICING TO
SAMPLE.NAME@COMPANY.ADDRE
SS.COM
333–111–0000

FROM ABOVE TEXT, only SAMPLE.NAME@COMPANY.ADDRE needed, sometimes there will be phone numbers after email address

Also, the phone number can be in a format like this:
SAMPLE.NAME@COMPANY.ADDRE123-667-9900
if there’s no space between .com and phone number, this regex can not identify. Is it possible to stop the pattern right after .com?

Hey @zkk

Take a look at these.

Sample #3
Sample #4

For a robust regex pattern we need clearly defined, Samples, expected OutPut and information on the Pattern.

Cheers

Steve

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