Regular Expressions 101

Community Patterns

Community Library Entry

-2

Regular Expression
Created·2014-10-03 05:32
Flavor·ECMAScript (JavaScript)

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

Description

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

#i18n #l11n #international

Submitted by Andreas Pizsa