Regular Expressions 101

Community Patterns

Decimal up to 15.2 digits in French and English culture


Regular Expression
ECMAScript (JavaScript)



Validates that a given string is a number of up to 15 integer digits and up to 2 decimal digits. Group separators could be either comma or space class but can't be mixed. Decimal separator could be either comma (if comma was not a group delimiter) or dot.

This variation uses small captures for mode detection (instead of back references)

v5 fixes a little bug when , is used as group separator and , was still accepted as decimal separator v6 is ECMAScript compatible

Submitted by BkQc - 10 months ago (Last modified 9 months ago)