[Editted]
I'm relatively new to regex, now I am facing a use case where the target string should contain exactly ONE dot '.'. To be more specific, I'm doing a floating point detection where I believe there should contain only one dot, and an exponent "e".
My regex now looks like this: (?=.*[0-9]{1,})(?=.*[\.][0-9])(?=.*[eE][+-]?[1-9]). It seems to be working on test strings like:
2.1E12
3.141E23
But once I test with:
1.15E10.34
It still passed.
Does anyone know what I did wrong here? Also could someone please recommend a good resource for learning regex?
Thanks!
"."? Or that it should start with exactly one dot? Or that it must contain exactly one dot? Or something else?