User Tools

Site Tools


regex:numbers:decimal_places

Regex - Numbers - Decimal places

Numbers not beginning 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 or 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.txt · Last modified: 2022/09/20 23:12 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki