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: 
seams that you are missing quantification, `[\d.]` will match only 1 character, so 1 should be selected, 10 on the other site requires something like `+`, so try your regex like:
`td[matches(text(),'\d+')]`

Also that `.` in regex will make it capture non-digit characters, do not add that one.

You can test all your regex queries on [regex101](https://regex101.com/).
Replace:

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

```

with:

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

```

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