I need a robust regex that will match all characters until a float.
I have a dict of strings with strings looking like the following mock example:
'some string 1 some more 2.1 even more 9.2 caracala,domitian2.3'
...
I need a robust regex to substring each string only on the floats, so the end result will look like this:
{
'some string 1 some more': '2.1'
'even more': '9.2'
'caracala,domitian': '2.3'
}
I'll use a for loop with python re to get the end result but I need a robust regex that will match all characters until a float.
I have tried: [-+]?\d*\.\d+|\d+
but it selects numbers as well