If there is always a dot after the final number then you can use the following expression:
\d+(?=\.(?:[^\d]|$))
This will match one or more digits \d+
which are followed by a dot .
then something that is either not a number [^\d]
of the end-of-string $
, i.e. (?=\.(?:[^\d]|$))
.