Extract Invoice Number from Email Subject for workflow

Hi Everyone,

I want to extract the invoice number from email subject.

Email Subject:
Reply Requested: Bank Of India Corporation (BOIC High Grade Capital Markets 52103244HGPU)- Due By: 10/25/2025

I want to extract invoice number which will be floating: 52103244HGPU
Rest the email subject will be same

Thanks

Hi @Binod_Kumar_Biswal

Can you try the below

\d{8}[A-Z]{4}

Or

(?<=Capital\s+Markets\s+)([0-9A-Z]+)

Regards,

Hi @Binod_Kumar_Biswal

As you said the rest of subject will be the same, you may try this way.

emailSubject = “Reply Requested: Bank Of India Corporation (BOIC High Grade Capital Markets 52103244HGPU)- Due By: 10/25/2025”

startPosition = emailSubject.IndexOf(“Markets”) + “Markets”.Length + 1
invoiceNumber = emailSubject.Substring(startPosition, 12)

@Binod_Kumar_Biswal

you can try this

\w+(?=\)- Due By)

cheers

Hi @Binod_Kumar_Biswal

Try this Regex

(?<=Markets).*(?=\))

StrVar = System.Text.RegularExpressions.Regex.Match("YourStrInput","(?<=Markets).*(?=\))").ToString.Trim

Regards,
Gowtham K