How to search for exact text using xpath and regex?
Asked Answered
P

1

1

An html paragraph contains the text Join {text} Now, or Join {text} Today. The xpath locator I created for this does not work. How do I make it work ?

//p[matches(text(), 'Join.*/^Today$/|/^Now$/')]
Prognostic answered 31/5, 2017 at 18:56 Comment(0)
T
-1

I created one on the http://regexr.com/. Is stayed like this: \bJoin.*(\bToday|\bNow). Try it.

Tompkins answered 31/5, 2017 at 19:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.