I am trying to match the out of the below data which conatins some values in decimals
data = Ver, 3.0.9
for matching I am trying
match = re.findall(
r"Ver,\s*\d+.?\d+",
data,
)
but I am getting the below output
Ver, 3.0 # .9 is missing
Is there any better way to match this kindly suggest I am aware I can add one more time \d+.?\d+ for matching this particular result but if the values are more than this decimals points it will fail
>Solution :
You can try using the Following regex:
import re
a = '30.0.9'
print(re.findall('[\d+\.]+', a))
Output:
['30.0.9']