Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

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

Description

Basically take a number and split it into thousands. I.e. take three chars from the end of the number until there is 3 or less chars left.

Submitted by Axb - 9 years ago