Regex Help to Get Value from Subject of email

Hi,

I would need regex help to get the value from the subject of the email.

Please find the email subject below.

RE: XXXXXXXXXX – XXXXXXXXXXXX – 1111A1-20-G-00338 XXXXXXX
Or
RE: XXXXXXXXXX – XXXXXXXXXXXX – 1111A1-20-I-00338-0012 XXXXXXX

I want to be able to read the value from the subject of email. The value
will be in the following formats 11111A1-20-I-00338 Or 11111A1-20-I-00338-0012

These values can be aplha numeric.

Can someone help me with this.

Thankyou

Have a look on following very generic pattern:

\b[A-Z,\d\-]{18,}\b

I used the regex you gave on my email subject but it dint extract the value.

Here is the sample subject content.

RE: New Value has to be added – New Ticket (GAR 42.253-89) for ensuring correct ticket bookings – 2082K5-18-M-00228


just reduce the minimum length to 15. Also provide always all samples / variations on begin. Then we can best select solution options. Thanks for support

1 Like

This works great thanks !!

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