How to build a selector that detects an actual * in the selector instead of a wild card

How do I build a selector that would detect

ItemOfIntrest* but not ItemOfIntrest ?

For example below detects both.


Try writing it as ItemOfIntrest\*. The \ should escape the * character.


I already tried to use an escape character no luck.

In the past i know it could not be done with * or ?, so you could use a workaround of using find children with the wildcard and then processing the results to see the right element for you…

1 Like

give a try to regex Selector

1 Like

Can you apply a regular expression to a object selector?

Are you saying to find children as in detect child elements that are unique to this type of value? If so in this case it’s just numbers in columns and even the columns are variable.

I do have a workaround now that detects if the item exist, then checks the text value of the item for the * which I can then do an if bool statement to process the correct one. Still curious if there are other ways of doing it. I tired using a char value without any luck thinking using the value as an object instead of a string would change behavior, but it looks like it still get treated as a string.

give a try like this:

Yes, you can add this to your selector:
then you can use expression like this:
... matching:name='regex' name='<<regex expression>>'...

1 Like

I am trying to make this work and it does not like the <<>> around the regex statement. For example

If I try to select the title of this forum the second > seems to be the breaking point of the selector.

Ok I am laughing at myself realizing the << >> where not part of this. That said I am still having issues getting it to work.

I tired the following without success

<webctrl matching:aaname='regex' aaname='(^How to build.*$)' parentid='app' tag='SPAN' />
<webctrl matching:aaname='regex' aaname='^How to build.*$' parentid='app' tag='SPAN' />

Well if i wanted to get that element i would do:
<webctrl matching:aaname='regex' aaname='actual \*' parentid='app' tag='SPAN' />

You can use this: to try your expressions.

1 Like

That is not working either, the regex is correct. does this work for you?
RegExSelectorMatch.xaml (5.5 KB)

Sorry, in our case the expression must match the full content of our tag, use this:
<webctrl matching:aaname='regex' aaname='(.*)actual \*(.*)' parentid='ember6' tag='SPAN' />

1 Like

Ok so I tired this as well and am still having issues. What version of studio are you on?
STUDIO: 2019.10.3

Can you supply a simple project or sequence with a working regex selector(If its not to much to ask your help has been amazing on this one)?

I am on the latest stable, but regex in this case would work in your version as well… the only thing that you need is that the regex expression need to fulfill the entire tag you choose and not only part of it. It should work in your project like this to highlight this post title:

1 Like

Thank you finally got it to work!!! looks like it does not work in IE only chrome!

Im afraid we all should slowly stop using IE, as im afraid it is getting out of support some time in the future…

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.