Get Specific Email Subject

From the email subject :PX #110 - Grease Trap, How can i get only store no that is 110 and the issue reason that is Grease Trap?

Hi @aparna30

  1. You can get mail subject and store it in a variable.
  2. Use regex expression to get the “110” value from that.
    System.Text.RegularExpressions.Regex.Match(Inputstring,“Expression”).tostring

Can you please share the sample mail subject

Regards
Gokul

Hi @aparna30

Could you please try below regex and capture the values in groups

#(\d+)[\s-]+(.*)

image

Thanks

1 Like

Thanks…but please could you guide me how can i store these group values in a variable ?

Hi @aparna30
Try the Expression

System.Text.RegularExpressions.Regex.Match(“PX #110 - Grease Trap”,"#(\d+)[\s-]").Groups(1)

Regards
Gokul

Hi @aparna30

Please find the sample xaml

RegexIdentifyGroup.xaml (6.0 KB)

Thanks

Hey, @aparna30 ,

check the below screenshot.

Logic : System.Text.RegularExpressions.Regex.Replace(":PX #110 - Grease Trap", “[^0-9]”, “”).trim

1 Like

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