For example you are waiting for an object with a message like
“6 card(s) processed successfully.”
"6 card(s) processed successfully."
where 6 could be any number. Here’s how to use isRegExpMatch descriptor to identify that object.
First, change the ID method of the object to Descriptors and open the Descriptors Editor.
Then, add a text property (if it’s not already there) and set the operator to isRegExpMatch.
When using isRegExpMatch, make sure the value type is set to JS.
Now for the value, I’m not an exepert at regex so I make use of online regex tools to generate the correct expression. I use regexr.com, set the regex engine to Javascript, paste the text I want to match on the textarea, and play around with capturing groups until it matches the entire text.
Here’s the regex expression that perfectly matches the entire text:
/(.*) card\(s\) processed successfully./g
There are other variations to this, but this is what worked for me hehe.
When entering the regex value back on the descriptors editor, make sure to include the open and close slashes and the g modifier at the end (in red).
If you notice, the parentheses in (s) are also escaped (in green).
You can always test the descriptor by highlighting the object when it’s visible on the page.
Here’s another example:
Say you want to match an object with a name like this, where there’s a random alphanumeric element in between the path…
/objects/ProfDetTransfer/rows/2g6efbadc10f2d3aaf4d06e1e2307as/attributes/TargetMatterRel.DisplayName
Same thing! Pull up a regex editor..
– replace the dynamic parts with a capturing group
– escape the forward slashes
– enclose the pattern in slashes
– add a g modifier
Here’s the expression for that:
\/objects\/ProfDetTransfer\/rows\/(.*)\/attributes\/TargetMatterRel.DisplayName
Hope this helps!