Regular Expressions 101

Community Patterns

Test numeric input to be between 0,01 and 100,00

2

Regular Expression
ECMAScript (JavaScript)

/
^(0(?=,(0[1-9]|[1-9]\d?))|[1-9]\d?|100(?=,0{1,2}$)|100(?!,\d{2}))(,\d{1,2})?$
/

Description

Tests a numeric input to be between 0,00 < input <= 100,00. Decimals are optional but have at max 2 places.

Submitted by Torsten Walter - 8 years ago