The snippet gets the mail from the mailbox, compares the message body with the Regex search pattern and prints matching contents.
In GetMailMessages activity, Regex search pattern cannot be used. It will not return proper results. In this code, Matches activity is used to search a given Regex pattern in the body of the mails.
It can be modified further to support multiple groups in Regex search pattern, return matching contents along with email details such as from, to, cc, subject, etc.,