Table of Contents

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})?$