Hi, I have a bot that grabs links and saves them in a txt file.
What I want, is to check if the link already exists inside that txt, so it won’t get added again.
This is how the txt looks inside
https://domain.com/323971BEDD
https://domain.com/1AC9FB8BAD
https://domain.com/21036C5DD8
https://domain.com/2A121D9397
https://domain.com/143BF87C9F
https://domain.com/21BAD005DD
https://domain.com/21BAD005DD2
I made the next RegEx inside the page regexr.com
As you see, it is matching exactly what I need. The problem comes when I try to use that expression in UiPath.
The link that will save in the txt (and thus the one that I want to check) comes inside a string variable, and inside the variable the format is exactly this one
“https:\/\/domain.com\/21BAD005DD(\n|$)
”
As you see, I’m scaping the “/” characters due to the RegEx Match.
This is the RegEx Match that I’m using
System.Text.RegularExpressions.Regex.Match(strTxt, strLinkToCheck).Success
The variable “strLinkToCheck” contains
https:\/\/domain.com\/21BAD005DD(\n|$)
The variable “strText” contains
https://domain.com/21BAD005DD
https://domain.com/21BAD005DD2
The problem is that it always returns false inside UiPath when I run it. Doesn’t matter if the link is inside the txt or not, it always returns false.
Can anyone help?. I’ll will appreciate it.