Regular Expressions 101

Community Patterns

Decimal number

1

Regular Expression
ECMAScript (JavaScript)

/
^[+-]?(\d{1,3}(,(\d{3})?)+(\.\d+)?|(\d*\.)?\d+)$
/
mg

Description

Matches any decimal number. Supports positive/negative sign, thousands separators, and implicit zeros.

Submitted by XeNoX (D:T0M11#1774, G/XNX11, i@xenox_officiel, T@XeNoXoff) - 2 years ago