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
lrtetala
(Lakshman Reddy)
2
Hi @Binod_Kumar_Biswal
Can you try the below
\d{8}[A-Z]{4}
Or
(?<=Capital\s+Markets\s+)([0-9A-Z]+)
Regards,
dkollyns
(Diógenes Kollyns )
3
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)
Hi @Binod_Kumar_Biswal
Try this Regex
(?<=Markets).*(?=\))
StrVar = System.Text.RegularExpressions.Regex.Match("YourStrInput","(?<=Markets).*(?=\))").ToString.Trim
Regards,
Gowtham K