Regular Expressions 101

Community Patterns

number separator positions

1

Regular Expression
ECMAScript (JavaScript)

/
\B(?=(\d{3})+(?!\d))
/
g

Description

finds the positions in a number to be replaced with a thousands separator, e.g. 12345 => 12`345

Submitted by anonymous - 9 years ago