Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
^(?:[$](\s{0,1})|)[+-]?(\d{1,3},?(\d{3},?)*\d{3}(\.\d{0,2})?|\d{1,3}(\.\d{0,2})?|\.\d{1,2}?)$
/
gm

Description

Currency with dollar sign, two decimals, negative allowed, starting with period ok

Submitted by Natalia Zolotareva - 3 years ago