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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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