Regular Expressions 101

Community Patterns

Community Library Entry

-2

Regular Expression
ECMAScript (JavaScript)

/
\b((?:\d{1,3})(?:([,. ']?)\d{3})?(?:\2\d{3})*)(?:(?:|(?!\2))([,./])(\d+))?\b
/

Description

Parse decimal numbers with optional thousands and/or decimal separator.

#i18n #l11n #international

Submitted by Andreas Pizsa - 10 years ago