How to use match function to extract value


I want to extract ‘‘invoice’’ alone from subject: XMLReader ERROR-invoice
I used Label before:“XMLReader ERROR-” and Label After, but getting empty result
“(?<=” + labelBefore + “)(.*?)(?=” + labelAfter + “)”
Can someone help me.

@NagaSujitha Everytime invoice will be in the same format are different can you provide more example so it will be easy to provide solution for you

I want to extract value from Subject mail. Format will be same only
eg: i have mentioned below 3 sample mails , in that i need only value after ‘ERROR-’ like invoice,customerParty or salesorder So that based on extracted values i can check service status.

  1. XMLReader ERROR-invoice
    2)XMLReader ERROR-customerParty
  2. XMLReader ERROR-salesorder


Assign v1 = “XMLReader ERROR-invoice”

Assign v1 = v1.Split(“-”.ToCharArray)(1)

Thank you Indra, It worked

1 Like

Can someone help me to extract only ‘UnexpectedCountMuleServiceActive’ from below String,
Event Code: UnexpectedCountMuleServiceActive

I used
writefile.Substring(writefile.IndexOf(“Event Code”)+12,45).Split(“x”.ToCharArray)(0)