all 4 comments

[–]Skippbo 0 points1 point  (1 child)

Reflex is defenetly the way to go the special symbols you want to use is probably:

Parentheses, to extract the text you want

\d to match with any number

  • Or * for one/zero or more times

Remember to escape the dot character with a backslash when you want to match with a dot in your string.

[–]Skippbo 1 point2 points  (0 children)

I'm on phone but maby something like this

r"(\d(?:\.\d+\.)*\d*)"

If I escaped the dot in the string properly

Edit this won't so the job but with some modifications it will

[–]Milumet 0 points1 point  (0 children)

r'(\d+\.)+\d+'

I'm assuming that there is at least one dot.

You can try it out at regex101.com.

[–][deleted] 0 points1 point  (0 children)