regular expression wildcard

Ask general questions here.
sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

regular expression wildcard

Post by sstowe » Thu Aug 09, 2018 3:26 pm

I have an xpath for an item ?/?/ul/li/?/?/div[@innertext~'^\ needs\ your\ review\ and\ ap']

The word needs may sometimes be need if the number of things to which is referring is plural. I am not seeing any examples on the internet to specify variability or wildcard for this. Is this a simple regex that I am just not getting? Thanks.

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: regular expression wildcard

Post by Stub » Thu Aug 09, 2018 3:58 pm

Maybe something like this:

need[s]?

I'm no regex expert, I just tried this on rubular.com very quickly as I'm about done for the day!

sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

Re: regular expression wildcard

Post by sstowe » Thu Aug 09, 2018 4:21 pm

Thanks. Alas, no. The item is not found when the s is present. I will try rubular.com to flush it out.

sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

Re: regular expression wildcard

Post by sstowe » Thu Aug 09, 2018 5:10 pm

needs? does the trick. Thanks.

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: regular expression wildcard

Post by Stub » Fri Aug 10, 2018 8:34 am

Huzzah! Of course! Rushing at the end of the day there... I always seem to end up Rubular.com doing on my regex experimenting.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: regular expression wildcard

Post by odklizec » Fri Aug 10, 2018 9:29 am

Hi guys,

Are you aware there is a built-in regex editor in Studio (look under Tools)? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

sstowe
Posts: 62
Joined: Thu May 31, 2018 2:26 pm

Re: regular expression wildcard

Post by sstowe » Fri Aug 10, 2018 2:20 pm

Not aware! Thanks! I Am Super Happy! Did I mention that I love Ranorex?

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: regular expression wildcard

Post by Stub » Tue Aug 14, 2018 8:44 am

Nor was I! Blinkers on, I just go with the tool I usually use when formulating regex for my production code. A web browser is usually open so I defaulted to that. Next time I have Ranorex open I'll take a look, if I remember. Top tip, odklizec.