Regex on selectors is not working (matching:title='regex')

I tried to execute the below selector.
<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='(^Personnel)|(^Create)' matching:title='regex' />

But when I am trying to validate, it is showing as Invalid.

in general the wildcard for selectors without regex should work:
<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='*Personnel*' />

otherwise keep in mind that the Dot in regex is expressing any character

it could look like this:
<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='(Personnel.*)' matching:title='regex' />

grafik
vs.
grafik
with the meaning of:
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

1 Like

Thanks for the reply.
Basically I want to recognize an element in any page whose title starts with Personnel or Create.

title=’(^Personnel)|(^Create)’

can you check:

<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='^(Personnel|Create)' matching:title='regex' />

<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='(^Personnel.*|^Create.*)' matching:title='regex' />

1 Like

Thanks a lot @ppr
It is working :
<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='(^Personnel.*|^Create.*)' matching:title='regex' />

image

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