Regular Expressions 101

Community Patterns

Commafication (this BREAKS ON APPLE DEVICES!!!!)

0

Regular Expression
ECMAScript (JavaScript)

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

Description

Commafy any number!

30000 = 30,000 303123 = 303,123 999888777 = 999,888,777

Submitted by Mendel Groner - a year ago