I'm currently using the following regex expression for currency in my input form fields: my requirement is maximum length of input field is 16 digit and after that decimal ( . ) then two digit. i try this expression but it not working. something wrong with my expression.
^(\d*\.\d{1,2}|\d+){0,16}$
Valid
//space- if user leave input box as blank
0
0.9
9999
9999.0
9999.00
9999999999999999.00
Invalid
0.00.
99999999999999999.00
999......000
AB999
$99.00
Note :-Alphabet and symbol will not allowed (only . will allow)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.