Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
\B(?=(?:(\d\d)+(\d)(?!\d))+(?!\d))
/
g

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 - 2 years ago