Community Patterns

Community Library Entry

0

Regular Expression
Created·2018-06-22 15:45
Flavor·ECMAScript (JavaScript)

/
^\s*[-+]?(\d+\.?\d*|\d*\.?\d+)([eE][-+]?\d+)?\s*$
/
gm
Open regex in editor

Description

Should be able to match a dot-separated decimal number (C-style)

Works with:

  • integers
  • floating-point
  • scientific notation
Submitted by anonymous