User Tools

Site Tools


regex:numbers:decimal_places

This is an old revision of the document!


Regex - Numbers - Decimal places

Numbers not begin with 0 and maximum 2 decimals

^([1-9][0-9]*)+(.[0-9]{1,2})?$

Positive or Negative numbers with maximum 2 decimals

^(\-)?\d+(\.\d{1,2})?$

Positive, Negative numbers and any decimal length

^(\-|\+)?\d+(\.\d+)?$

Numbers with maximum 2 decimals

^[0-9]+(.[0-9]{2})?$

Numbers with 1-5 decimals

^[0-9]+(.[0-9]{1,5})?$

regex/numbers/decimal_places.1663715438.txt.gz · Last modified: 2022/09/20 23:10 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki