I want to match all the numbers in a string given in scientific notation, heres my program
import re
txt = '2310163 -204.1154263 -204.1159668 -204.1110188 -204E-9668 200-100'
print re.findall('([+-]?\d+\.?[eE]?[+-]?\d*)', txt)
# ^ ^
# ex sg
# allow sg only if its followed by ex
Now the 200-100 is not a valid number but the regex matches it, because I have given a [+-] for the exponent part. Now how to make regex so that it only checks for [+-] if it just followed by [eE] like the number -204E-9668 ?