Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(0|-?0\.\d+|-?[1-9]\d{0,14}|-?[1-9]\d{0,18}\.\d+)$
/
gm

Description

  • 15 digits for integer
  • real number: 18 digits for before-dot part (*what it's called?)
Submitted by anonymous - 7 years ago