Regex how to extract a floating number from a string

PHOTO EMBED

Wed Oct 05 2022 02:50:24 GMT+0000 (Coordinated Universal Time)

Saved by @ianh #python

>>> re.findall(r"[-+]?(?:\d*\.\d+|\d+)", "Current Level: -13.2db or 14.2 or 3")
['-13.2', '14.2', '3']
content_copyCOPY

https://stackoverflow.com/questions/4703390/how-to-extract-a-floating-number-from-a-string