Community Patterns

Community Library Entry

1

Regular Expression
Created·2018-08-08 17:54
Flavor·ECMAScript (JavaScript)

/
^(?:[1-9]\d*?|0)?(?:\.(?:\d*?[1-9]|0))?(?<=[\d])$
/
gm
Open regex in editor

Description

Matches a decimal, but only allows for leading/tailing Zeros if they are the first digit to precede or follow the decimal point

Submitted by Doom87er