10-06-2011 01:15 PM
For the original poster, you could expand the regex to include all floting point numbers by searching for regex [+-]?\d+[.]?\d*+(?:[eE][+-]?\d+)
This regex can be simplified to [Ee+-\d.]+
The original RegEx of Stephen's is actually fairly common, and is meant to *only* match floating point numbers with or without the exponential notation. The simplified version will match a lot of patterns that are not properly formed floating point numbers (E+e12+E-2ee). Depends on how well you know the form of the input, and how much you trust it.
10-06-2011 01:19 PM
10-06-2011 01:46 PM
10-06-2011 02:00 PM
In cleaning up the quote the final ? was chopped off of the regex so the non-capture group is optional. I agree, no need for a greedy quantifier beforehand, no harm though.