Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The regular expression that will only allow decimal input is:

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

This expression will allow for any positive or negative decimal number, with or without leading zeros, and can also handle decimal numbers with or without a decimal point.