Page 1 of 1

Regular Expression

Posted: Tue Jun 07, 2016 10:49 am
by thirukumar
/form[@title='Equipment Operators']

/form[@title~'^Shift\ Change\ -\ Cat\ MineSt']

My answer for above by using regular expression
1) /form[@title~'*.*']
2) /form[@title~(=|~)'*.*']
3) /form[@title~(=|~)'*.*']
4) /form[@title*]
5) /form[@title*.*]

All failed. Any Suggestion on this how to use regular expression.

Re: Regular Expression

Posted: Wed Jun 08, 2016 12:49 pm
by odklizec
Hi,

Matching form with "any" title is not a very good idea (if this is what you are after). You see, this could take a very long time to find all forms and it may return many irrelevant forms!

If your application can have either of both titles, then use OR operator in you xpath, like this:

Code: Select all

/form[@title='Equipment Operators' or @title~'^Shift\ Change\ -\ Cat\ MineSt']

Re: Regular Expression

Posted: Wed Jul 06, 2016 12:38 pm
by thirukumar
Thank You Odklizec. It worked with your idea.


Thanks.