How to read specific patterns of string (by following an order) - Telegram

Dear all,

I’m currently automating the web version of Telegram and would like some help with the following case:

When extracting the group conversation, this same pattern(that I wish to keep) is always repeating itself, many times:

AGE SOMETHIN (@ 1.7752)
Take Action 1 at 1.0325
Take Action 2 at 1.0325
Take Action 3 at 1.0325
End age at 1.0430


AGE GOOGLE(@ 1.7752)
Take Action 1 at 1.0643
Take Action 2 at 1.0963
Take Action 3 at 1.0325
End age at 1.0430


Unfortunately there is a lot of useless strings (conversations), in between these patterns. Is there an specific way to Eliminate/replace or filter the useless strings?

The main goal is to specifically only process these patterns and make the robot read the patterns, one by one (in a loop, maybe).

Thank you!

Hey @rauni_ribeiro

You can use Regex to read only certain parts of a string.

If you provide a full sample, expected output and information on the pattern you want to capture.

Hopefully this helps :slight_smile:

Check out my Regex Megapost if you want to learn more:

@rauni_ribeiro - What is the string you want to extract from the above pattern??

@Steven_McKeering - I am not positive that, Regex can be used in Studiox?

Have you ever tried that? If so, please advise…

Please check this…

Hey @prasath17

Oh really, I haven’t checked in StudioX…

@Steven_McKeering - Even though there is no matches activity, it is still supporting Regex.match/matches code…I just tried the below and got the output

“Output is: " + System.Text.RegularExpressions.Regex.Match(“Valent valerie de coster - werkt voor - Ik weet het | ja heb”,”(?<=-\s).*?(?=\s-)").ToString

Output is: werkt voor

1 Like