<listRel:entityId>(.*?)<\/listRel:entityId>

37 Views Asked by At

Good day.

My work requires me to query and get response from it. I cannot seem to remove the letters or name on this Match group. I need to get just the numbers 917857

I use rubular to check if the match is correct.

917857 James Bond

1

There are 1 best solutions below

3
On BEST ANSWER

Here is the Regex to get the number where the number is at the start of the string and is only numbers:

\<listRel:entityId\>(\d+)[\s\w]+<\/listRel:entityId\>

Here is a working example: Regex101

This is adjusted to match the additional input example.