I want to identify a string, for instance:
a = 'KI83949 anythingHere 900.00 1 900.00'
the string consists of three part:
index part is the string before the first space
- 'KI83949'
which can be anything and for most of the time, it is chars+digits.
string between a[0] and the first floating number
with two decimal points is the seconde part
-'anything here'
which can be anything
starting with the 2-decimal-point floating number is the last part
-'900.00 1 900.00'
which can be
'900.00' or '900.00 1 1003.00' or '900.00 100.00'
float or float+int+float or float+float
Numbers here will change. For the whole string, the number part is always there while the previous two parts may not. I am trying to filter out string with above features from thousands of other strings. I have tried several ways to express this but still failed. Sorry for my poor regex knowledge. The most close shot is as following:
'.*\s?[\d.]+(\s\d)?[\s\d.]+$'
However, it will return something like 'TS90190' or '80 thda 4318'. After spending hours on this, now it is driving me crazy. Can someone help me with that?