Hi,
Does the wild card “?” represent one character or “none or one” character?
For example, if I say AN? does it represent both “AN” and “AND”
thank you,
Hi,
Does the wild card “?” represent one character or “none or one” character?
For example, if I say AN? does it represent both “AN” and “AND”
thank you,
Wildcards are symbols that enable you to replace zero or multiple characters in a string. These can be quite useful when dealing with dynamically-changing attributes in a selector.
Reference: Studio - Selectors With Wildcards
AN? will match AND and not AN.
?
represent one character!
It’s not! Because when you put question mark (?) at the end of the “AN” it expects one more character. So it validates 3 characters that starts with “AN”. But you can use asterisk(*) for this.
But I check on "https://regex101.com/ ". It showed a match for AN.
?
Hi @A_Learner,
Different systems can have somewhat different working and different notations wrt wildcards.
For e.g in SQL, wildcards are % and _
But in UiPath, we have * and ? Where * represents zero or more characters and ? Represents only 1 character.
Below post also talks about a certain regex working in online reflex but not in UiPath, different platforms can respond differently based on underlying technology.
If you want to build a regex for UiPath and test it, I would suggest using regex builder:
Hope this helps.
Regards
Sonali
Hi @A_Learner,
Where do you want to use this wildcard? in selector? Wherever you want to make use of this, try using the expression(AN? or AN*) there to identify the difference in behavior.
Regards
Sonali
I am trying to match a pattern. Like I mentioned I am trying to match a pattern that has a D or no D in after “AN”. If I put a * it will match any character. I do not want that. That is why I am using AN(D)?
thanks,
Hi,
WildCard and Regex are different specification. In wildcard, ?
means any single character. However, in regex, ?
means 0 or 1 times for the previous character(or block).
If you want to use regex selector, the following document will help you.
FYI, the following is example of Wildcard and regex selector.
Wildcard
Regex
Regards,
For a regex match, is this correct to say [M|B]AT to match “MAT” or “BAT”?
Thank you,
If you need to match both MAT
and BAT
, regex pattern will be [MB]AT
or (M|B)AT
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.