Need help with regex on an inbound email action

Community Alums
Not applicable

I have never used regex so need some help please on an inbound email action. 

 

The inbound email will be from the same email address but the contents of the email will contain the ref number which will look like this on the email body

 

Version Visit Email Address:  sctask12345678@employeeworld.com

 

How can i do this so that inbound action will pick up the ref number from the email address and copy the email body into the sctask

 

The email address on  the email body will be different each time, the only thing which will be same on the email address will be sctask.

 

Thanks

H

 

 

 

 

4 REPLIES 4

Jan Cernocky
Tera Guru

Hey. 

So I understand that this is the content of the email body? 

Version Visit Email Address:  sctask12345678@employeeworld.com

a. Is this the only content or there is more text?

b. What is the actual ref number? In this case it is 12345678 or 12345678@employeeworld.com?

b. Will the ref. number always be the same length? Will it be in a certain format? e.g. stac[8numbers]at[various email domain]?

Community Alums
Not applicable

Hi @Jan Cernocky 

 

There is more content -  

Event Type:                   Assessment/Survey/Email List Entered
Notification:                 Fulfillment training
Document:                     Fulfilment Training
The ref number is SCTASK1234567 

The version email will always be a different ref number. It will always start with SCTASK followed by 7 digits and yes will be in the same format SCTASK1234567@employeeworld.com

 

Thanks

 

H

Hi, 

Regex pattern as below should help

/^SCTASK[0-9]{7}$/

 

Alternatively, you can use

var taskis=email.body_text.split('The ref number is')[1];

var numberis=taskis; //This gives you what you want

 

Sandeep Rajput
Tera Patron
Tera Patron

@Community Alums Here is the regular expression to identify email address

/^SCTASK[0-9]{8}@[a-z]*.[a-z]{2,3}$/i

Here is the email address to identify SCTask

/^SCTASK[0-9]{8}$/i

Hope this helps.