Need help with regex on an inbound email action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 03:38 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:59 AM
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]?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 08:28 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 08:37 AM - edited 11-09-2023 11:13 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 10:10 AM
@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.