Regular expression check amount

An arbitrary positive number, not exceeding two decimal places.

 /^(([1-9][0-9]*)|(([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2})))$/

If you want to confirm integer numbers,Change the above * to {1, n}. When n is equal to 12, the above expression indicates that the integer digit cannot exceed 13.

The above ensures that no spaces, no English and special characters are allowed.

Leave a Reply

Your email address will not be published. Required fields are marked *