I need a way to be able to use matching regex within a selector I have.
Currently in my automation, please view the
"WA2" in the screenshot:
"WA2" changes depending on the activity I’m trying to select, and I’ve identified that the variation will be
WA then one of 0,1,2.
Unfortunately, the classic
? wildcard is not working for me in this case (nor does
So I immediately thought that we can use the regex build
WA[0-2]* to be able to identify this selector rather then try to make a bunch of different combinations (This appears for a total of 3 times, so it’s not reasonable to create all the different variations).
That’s where I need help. I’m not sure how to actually construct the RegEx within the selector.
I tried following the documentation , and got this result:
Here are some other attempts of trying things from the documentation link:
Another idea I have is to make the actual
[0-2]* regex pattern as a variable then concatenate this into my selector. But I cannot figure out how to only have this value. The closest I could find was using
System.Text.RegularExpressions.Regex.Match("WA?","[0-2]*").Value which is correct syntax, but this does not work in the selector! I can’t say in advanced what the string I’m modifying is so I need that wildcard.
I could really use some help here! Thank you!
Relevant links I visited but did not help me get an answer yet: