Regular Expressions 101

Community Patterns

0

rs-reg

PCRE (PHP <7.3)
personal patterns
Submitted by anonymous - 4 years ago

Trim leading zeroes in numbers 012.210 => 12.21

1

Regular Expression
PCRE (PHP <7.3)

/
^(\-{0,1})(?:(?:0*)(\d+))?((?:\.)(?:\d*?))?0*$
/
gm

Description

Loading markdown...
Submitted by FAy - 7 years ago