Question: I'm trying to write an xpath such that only nodes with text with numbers alone will be returned.
I wanted to use regex and was hoping this would work

```
td[matches(text(),'[\d.]')]

```

Can anyone please help me understand what am I doing wrong here

```
<tr>
        <td>1</td>
        <td>10</td>
        <td>a</td>
</tr>

```

Answer: 
AFAIK so far Selenium support XPath 1.0 only, so `matches()` is not supported.

You can try below instead:

```
//td[number(.) >= 0 or number(.) < 0]

```

To match table cells with integers
Replace:

```
td[matches(text(),'[\d+]')]

```

with:

```
td[matches(text(),'\d+')]

```

***Note:*** regex works only in `xPath 2.0`