Multiple occurences

Hello friends,

in some emails I get (which are some times forwarded), in the bosy there are multiple times the combination
“From: ******
Sent:******”
with some text between.
How to set up a regex that gets all the combinations of “From: ***** Sent:” present in the body of the email, not separately, not from the first From: to the last Sent: ??
Thank you ,
CAmi:)

Hi @CamiCat,

Can you provide sample text with expected output.

Thanks,

1 Like

Hello @Gouda_6,

for example this case:

From: Forex
Sent: mercoledì 5 aprile 2017 09:59
To: Estero
Cc: Forex
Subject: FW: Ordine vendita divisa cdg 1158813

VDIVS
1158813
50794547
USD
4.278,13
05-apr-17
07-apr-17
1,0718

Erik Moratto

Forex

­­

Int.77449

Fax +39

From: Conti Giuseppeino (PB di Banca )
Sent: mercoledì 5 aprile 2017 09:50
To: Forex
Subject: Ordine vendita divisa cdg 1158813
­­
Can you please help me?
Thank you,
Cami

Hi @CamiCat,

Try using this regex

From:.+\nSent:.+\nTo:.+\nCc:.+\nSubject:.+

Later replace FW:
resultString.replace(FW:,“”)

Thanks,

1 Like

Thank yuo so much @Gouda_6.
I’ll try and let you know.
Can you also have a look at the post : Save sender email and check in File excel?
Thank you so much,
Cami :slight_smile: