My goal is to find text that will always start the same way, the middle bit needs to be a wildcard because it’ll be different text a with different amount of characters (sometimes 5 characters, sometimes 6 or 7), and the end will need to be a variable - e.g.
“Payment of” (wildcard) “to” variable
To do that rather use the ‘Matches’ activity, which accepts regular expressions.
If you just want to see if there is any match, you can simply use IsMatch Activity.
For you example it would be something like this.
Input your text block there.
Use the following as pattern.
"Payment of .{5,7} From " & strName
Create variables for the output matches (ex: regexMatches).
You can access the first one using regexMatches(0).ToString
I recommand you some further reading on Regular expression in .Net on the web if you want to go further. Very useful thing
Hi,
What is not working about it? Are there errors or anything?
You might want to output DocumentScreen to make sure it’s the right text before you look at it.
also, the “&” I think it supposed to be a + "Posted Client payment for (.*) to "+Surname
Just a quick comment - in VB.Net the & operator works for primitive types and strings, by implicitly calling .ToString() on the non-string primitive type: "abcd" & someInt ->(same as)-> "abcd" + someInt.ToString()
See here for more on the operator.
Note: it’s actually recommended to use & operator for string concatenation, to indicate code intention.
Logically if should work out if you assign your variable to “Mr Fake Surname” and the visible text would be containing “Posted client payment of €15.55 to Mr Fake Surname”
Also in place of .{5,7}, i would include some sort of currency pattern that you should be able to find on the internet.
It could appear in different variations, such as “Mr Surname”, “Fake Surname”, “Mr F Surname”, “F Surname” etc so as Surname will be the only part of the name to always appear, I was hoping to go off that. I’ve played around with it and can’t seem to get it working.