Scientific Notation
intermediateMatches numbers in scientific notation like 1.23e-4 or 6.022E23.
numberscientificexponentialparsing
Pattern
/-?\d+(?:\.\d+)?[eE][+-]?\d+/gTry It
0 of 8 strings matched
Explanation
Matches a number (integer or decimal) followed by 'e' or 'E' and an exponent (optional sign with digits).
Test Strings
Matching
- 1.23e-4
- 6.022E23
- -1e10
- 5.0e+3
Non-matching
- 1.23
- e10
- 1.23e
- abc
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /-?\d+(?:\.\d+)?[eE][+-]?\d+/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);