Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-10-28 10:48
Flavor·PCRE2 (PHP)

/
\B(?=(?:(\d\d)+(\d)(?!\d))+(?!\d))
/
g
Open regex in editor

Description

converts a number to Lakh format, e.g:

123456789 == 12,34,56,789 breakdown: twelve crore thirty-four lakh fifty-six thousand seven hundred and eighty-nine

Submitted by anonymous