I’d like to extract all digits that occur in a string until a non-digit character appears. Example:

123test ----> 123
123_test ---> 123
123_321 ----> 123
123test000 -> 123
0123test0 --> 0123
123hej.321 -> 123

The following almost works, but doesn’t catch the last example:

re.findall(r"(bd+)", "123hej.123")

What do I need to add to the regex to account for this case?