Community Patterns

Community Library Entry

2

Regular Expression
Created·2022-01-21 14:47
Flavor·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
Open regex in editor

Description

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

Submitted by Natalia Zolotareva