Positive Decimal Regular Expression

A regular expression to match a positive decimal value.

/(^\d*\.?\d*[0-9]+\d*$)|(^[0-9]+\d*\.\d*$)/

Matches:

  • 0.00
  • 1.23
  • 3.456

Non-matches:

  • -0.00
  • -1.23
  • abcd

See Also: