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

**URL:** <https://forum.katalon.com/t/test-object-with-xpath-selector-using-matches-function-never-works/11822>\
**Category:** Bug Report\
**Tags:** katalon-studio, bugs-report\
**Created:** [July 3, 2018, 4:24am UTC](https://forum.katalon.com/t/test-object-with-xpath-selector-using-matches-function-never-works/11822 "2018-07-03T04:24:36Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [April 4, 2019, 9:33pm UTC](https://forum.katalon.com/t/test-object-with-xpath-selector-using-matches-function-never-works/11822/12 "2019-04-04T21:33:26Z")

</div>

You can live without the matches() function in XPath2.0. It is possible to implement “grep” with string pattern over a text content of a HTML element with XPath1.0 expression. The following comment shows how to:

> [@Using regex to find the id](http://forum.katalon.com/t/using-regex-to-find-the-id/10116/4):
>
> Alternative to Regexp, you can use XPath expression: You can select a div element with id=“Donors\_1233klf323sd\_Ti” by the following xpath: //div[starts-with(@id, "Donors\_") and substring(@id, string-length(@id) - string-length('\_Ti')+1)="\_Ti"]

---

_[View the full topic](https://forum.katalon.com/t/test-object-with-xpath-selector-using-matches-function-never-works/11822)._
