Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^\s*[0-9]+(\.[0-9][0-9]{0,2}?)?$|^$|^\s*$
/

Description

//Accepts whitespaces and positive numeric values including integers and decimals(ortional) with 3 precisions only.

//Ex: "999", "99999.999", " 999.999" -> ACCEPTABLE

Submitted by Pubudu (motustudio) - 9 years ago