regular expression for dynamic control

Ask general questions here.
murthyksvr
Posts: 27
Joined: Wed Jul 06, 2016 1:15 pm

regular expression for dynamic control

Post by murthyksvr » Mon Jul 18, 2016 2:24 pm

there is a control with name <statictText>_<dynamicString>.<staticText>. Ex: Planning_as1234wedzsed.Clinical. here "as1234wedzsed" is dynamic string. Which regular expression shall i use in this case

User avatar
Vega
Posts: 109
Joined: Mon Jul 11, 2016 2:15 pm

Re: regular expression for dynamic control

Post by Vega » Mon Jul 18, 2016 2:41 pm

It depends on how unique you need your regex to be. Here are a few simple examples:

"Planning_.*" will match "Planning_as1234wedzsed.Clinical" as everything after the "Planning_" is a wildcard.

"Planning_.*.Clinical" will match "Planning_as1234wedzsed.Clinical" but only allows for the dynamic portion in the middle to be a wildcard. Basically "Planning_" + wildcard + ".Clinical".

There is a RegEx tool within Ranorex to test your expressions with at Tools -> Regular Expressions Toolkit.