extract only continuous digits from string python using regex code example
Example 1: python get numbers from string
string = "abc123"
# Method 1
''.join(char for char in string if char.isdigit())
#Method 2
import re
re.sub("[^0-9]", "", string)
Example 2: split string with first numerical value in python
re.split(r'(^[^\d]+)', string)[1:]