This question is continuation of this question. The problem is that regex "[-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?" doesn't correctly find doubles.
For instance, input sdf9.99e.23 contains no doubles, cause if we have [eE], after it MUST be a [+-] or just [0-9].
So I need some kind of "if" in the regex. In pseudo-code it'll be like this: if(char[i]==(e|E)) then if(char[i+1] == ('+'|'-')) else return null.
sdf9.99f.23contain a double (or two)? I'd argue thatsdf9.99e.23contains two double values:9.99and.23. The whole problem of parsing unstructured text is that it's simply far too open to interpretation. Unless you have a very specific definition you can always find a case that could be argued over.eso special that it "breaks" the string. Why doesn'tfdo the same? Or an empty space? Why do you choose to ignore any other malformed non-number, but that specific case should cause your algorithm to return an error? In1ayou find1, in1byou find1, in1cyou find1, in1dyou find1, but in1eyou return an error. Why is that?e1e2e3e4e5eDoes this have five, three, two or no doubles?ecould also be a plaine