Regular Expressions 101

Community Patterns

Insert comma as thousands delimiter

1

Regular Expression
PCRE (PHP <7.3)

/
(?<=\d)(?=(\d\d\d)+\b)
/
g

Description

The following regular expression can be used to insert commas as thousands delimiter. The pattern was taken from the http://www.dlang.org web site.

Submitted by Unknown - 7 years ago