Test Object with xpath selector using matches() function never works

All I can do is to show you some workaounds.

Alternative to the XPath2.0 matches() function:

Alternative to the XPath2.0 ends-with() function:

In many cases (simple cases), the contains function of XPath 1.0 is useful, can be an alternative to matches function of XPath 2.0: