I have a variable called in_SenderName that has the name of the .txt file that i use to call in my Matchesactivity. But the regex expression is not working because of a little annoying thing as a double-space between the text inside my In_SenderName variable.
I want to get rid of that so it has the exact same output as the file name (with single space).
This is my text input:
The name of the file IbraUiPath (see the number 1 in the attached picture) is my variable name that i get from the file.
The number 2 is the name (with the double space) i use to retrieve the number 3 (with blue).
This is my Regex expression to retrieve UiPath Junior:
In that case, your input won’t be “Ibra UiPath”. Input will be the text inside the text file.
The problem is you’re trying to use your variable as the key or anchor here. But since there are two spaces in between the Ibra and Uipath inside the text file (not the variable) it won’t match. But since you’re absolutely sure that the file name is going to come right before the string you need, do this:
Regex.replace(in_SenderName," “,” +")
Use the above instead of in_SenderName inside your regex: