User Tools

Site Tools


regex:numbers:integers

Regex - Numbers - Integers

Positive Integer

^\d+$

or

^[1-9]\d*|0$

Negative Integer

^-[1-9]\d*|0$

or

^((-\d+)|(0+))$

Positive Integer, excluding 0

^[1-9]\d*$

or

^([1-9][0-9]*){1,3}$

or

^\+?[1-9][0-9]*$

Negative Integer, excluding 0

^-[1-9]\d*$

or

^\-[1-9][0-9]*$

regex/numbers/integers.txt · Last modified: 2022/09/20 23:14 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki