Regular Expressions 101

Community Patterns

Integers

0

Regular Expression
PCRE (PHP <7.3)

/
(^[-+]?[1-9]\d*$)
/
gm

Description

Integers with no leading zeros ie. 0234 or -0486 is invalid

Submitted by anonymous - 4 years ago