I have these two strings:
x ='plasma_glucose_concentration183.0000'
y = 'Participants20-30'
And want to split the strings as follow:
x: ['plasma_glucose_concentration', '183.0000']
y: ['Participants, 20-30']
I created this function, but only first string is split correctly:
def split_string(x):
res = re.findall(r"(\w+?)(\d*\.\d+|\d+)", x)
return res
When I split the second string I get:
[('Participants', '20'), ('3', '0')]
Is there any regex solution for this? Thx.