RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Scientific Notation
Expression
^(-?[1-9](\.\d+)?)((\s?[X*]\s?10[E^]([+-]?\d+))|(E([+-]?\d+)))$
Description
Matches both normalized and E notations, with or without spaces or negative numbers. Make sure to use a case insensitive pattern matcher. Group 1 is the significand, and either group 5 or group 7 is the exponent (one or the other will be null, but never both).
Matches
1.1 x 10^9 | 2.34 X 10^12 | 3.14159 * 10^30 | 1.1x10^9 | 2.34X10^12 | 3.14159*10^30 | 1.1 x 10e9 | 2.34 x 10E12 | 3.14159e30 | 1.1 x 10^-9 | 2.34 X 10^-12 | 3.14159E-30 | -1.1 x 10^9 | -2.34 X 10E12 | -3.14159 * 10e30 | -1.1x10^-9 | -2.34E-12 | -3.14159e-30 | 3.1459E+030 | 1x10^9 | 1E9
Non-Matches
0.1 x 10^9 | 23.4 x 10^12 | 3.14159 * 10e^30 | 1.1e8.3
Author Rating: Not yet rated. Jared Cook
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2014, RegexAdvice.com | ASP.NET Tutorials