I need some help with python regex. My "payload" string look like this "status=0/eStopStatus=2/version=1.0.16/runTime=005320" My code uses the following parse out a list of variables and values: variables = re.findall(r'([\w]+)=', payload) values = re.findall(r"[-+]?(?:\d*\.*\d+)", payload)  My variables are parsed correctly as: status eStopStatus version runTime  But the double . in my version value 1.0.16 trips up my values and I get 0 2 1.0 .16 005320  I must admit I am battling to understand the syntax of the parameters using regex for this. Any assistance appreciated
This will work perfectly: values = re.findall(r"[-+]?(\d+(?:\.\d+)*)", payload)  Here is a link to the pattern and test string: https://regex101.com/r/YbcMUR/1 TEST CODE: import re payload = "status=0/eStopStatus=2/version=1.0.16/runTime=005320" keywords_pattern = r'([\w]+)=' values_pattern = r'[-+]?(\d+(?:\.\d+)*)' variables = re.findall(keywords_pattern, payload) values = re.findall(values_pattern, payload) [print(variable) for variable in variables] [print(value) for value in values]  RESULTS: PS C:\..\regex_payload.py status eStopStatus version runTime 0 2 1.0.16 005320 