- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 02:47 AM
Hi Community,
Looking for a bit of assistance in using RegEx in an inbound action to match a unique reference from a third party.
The end of the email always contains two sets of references like in the example below:
[8795-WSDG-8348] [208e7252]
I only need to match on the first set which is always a set of 4 numbers, 4 alphabetic characters and another 4 numbers (separated by dashes within brackets).
I've used the format below previously for a very simple number match just wondering if anyone can amend this for the scenario above.
var eSubject = email.subject;
var regex = /[0-9]+/;
var ticketNum = eSubject.match(regex);
Many Thanks,
James
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 03:02 AM
Hi
If you want to create a regex only for the first part i.e. [8795-WSDG-8348], the below regex may help you -
\[[0-9]+-[a-zA-Z]+-[0-9]+]
Please mark my answer as helpful or correct if applicable.
Thanks,
Aishwarya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 03:02 AM
Hi
If you want to create a regex only for the first part i.e. [8795-WSDG-8348], the below regex may help you -
\[[0-9]+-[a-zA-Z]+-[0-9]+]
Please mark my answer as helpful or correct if applicable.
Thanks,
Aishwarya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 03:26 AM
This is working perfectly Aishwarya.
Thanks for such a speedy solution!
James

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 03:28 AM
Just to clear it will work but will accept characters or digits more than 4. Give it a check.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 04:21 AM
Glad it helped you, James! Thanks for marking it as Correct 🙂
Thanks,
Aishwarya