Regex expression for "Method claim was submitted"

Hi Team,

Please find below requirement I want to extract "Method claim was submitted : " from email body, but the email can have two different formats,

Method claim was submitted : Fax

Method claim was submitted (Fax,Mail,Electronic) : Fax

The bot should be able to extract whatever mentioned after “:” from the email body in our case it should be “Fax”.

Can anyone please help me with this issue.



1 Like

(?<=(Method claim was submitted).*:\s+)[A-Za-z]+

Follow this regex pattern

Let me know if it works! @avinash_ghanwat1 Regards

1 Like

Could you please add those Keywords Method claim was submitted, as in email there are many more lines with :

You can try this



Please use-

System.Text.RegularExpressions.Regex.Match(str,"(?<=Method claim was submitted (.*):)(.*)").Value


1 Like

@tazunnisa.badavide : I am getting pattern error while I am testing it on Regex 101 Please fine below screenshot for reference

you can try this syntax it will match all the fax even the format change

System.Text.RegularExpressions.Regex.Match(str12,"(?<=[Method claim was submitted|Method claim was submitted (Fax,Mail,Electronic)\s*]:).*").Value.Trim

output : regex builder

sytaxn in studio output:


1 Like

could you please try with below syntax-

System.Text.RegularExpressions.Regex.Match(“Method claim was submitted (Fax,Mail,Electronic) : Fax”,“(?<=Method claim was submitted).*”).Value.Split(":"c).Last.trim

It may be any string after ,“Method claim was submitted” above syntax will works.
as we are spliting with “:” and getting the last word


1 Like

try with ths

1 Like

@avinash_ghanwat1 Try with this regex now
(?<=(?<=Method claim was submitted )|:) [A-Za-z]+



1 Like

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