Hey Folks,
I am new to Ui path and trying to figure out mail parsing.
I have a requirement in which if I receive any IP address in the mail body, the bot would be able to identify the IP and later on sent/ forward the email.
I am able to achieve the forwarding of emails. But couldn’t figure out the way in which the bot will differentiate between IP’s like 1.1.1.1 or 123.34.52.12.
Would need your help in figuring out this.
What needs to be mentioned in the body condition to acheive this?
@Rushi_Muni If you’re familiar with regex you can use this :
System.Text.RegularExpressions.Regex.Matches(itemBody,“\b\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\b”).Count>0
@Rushi_Muni Inside if use this :
System.Text.RegularExpressions.Regex.Matches(itemBody,“[1]+([a-zA-Z0-9-][a-z0-9]+)?(.([a-z]+([a-z0-9-][a-z0-9]+)?)+)*$”).Count>0
@Rushi_Muni Can you try this :
System.Text.RegularExpressions.Regex.Matches(itemBody,“[a-zA-z.:/]+([a-zA-Z0-9-][a-z0-9]+)?(.([a-z]+([a-z0-9-][a-z0-9]+)?)+)*”).Count
@supermanPunch
For URL’s like https:// xyz.com
and domain- xyz.com ; www.xyz.com
The domain of provided regex isn’t able to classify properly- [1]+([a-zA-Z0-9-][a-z0-9]+)?(.([a-z]+([a-z0-9-][a-z0-9]+)?)+)*$").Count>0
@Rushi_Muni This Should work :
System.Text.RegularExpressions.Regex.Matches(itemBody,“[a-zA-z.]+([a-zA-Z0-9-][a-z0-9]+)?(.([a-z]+([a-z0-9-][a-z0-9]+)?)+)*”).Count>0