1. Expression of check digits
1 Number: ^[0-9]*$
2 n-digit number: ^\d{n}$
3 A number of at least n digits: ^\d{n,}$
4 m-n digit number: ^\d{m,n}$
5 Numbers starting with zero and non-zero: ^(0|[1-9][0-9]*)$
6 Numbers starting with non-zero and with up to two decimal places: ^([1-9][0-9]*)+(.[0-9]{1,2})?$
7 Positive or negative numbers with 1-2 decimal places: ^(\-)?\d+(\.\d{1,2})?$
8 Positive numbers, negative numbers, and decimals: ^(\-|\+)?\d+(\.\d+)?$
9 Positive real numbers with two decimal places: ^[0-9]+(.[0-9]{2})?$
10 Positive real numbers with 1~3 decimal places: ^[0-9]+(.[0-9]{1,3})?$
11 Non-zero positive integer: ^[1-9]\d*$ or ^([1-9][0-9]*){1,3}$ or ^\+?[1-9][0 -9]*$
12 Non-zero negative integers: ^\-[1-9][]0-9"*$ or ^-[1-9]\d*$
13 Non-negative integers: ^\d+$ or ^[1-9]\d*|0$
14 Non-positive integers: ^-[1-9]\d*|0$ or ^((-\d+)|(0+))$
15 Non-negative floating point number: ^\d+(\.\d+)?$ or ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0? \.0+|0$
16 Non-positive floating point number: ^((-\d+(\.\d+)?)|(0+(\.0+)?))$ or ^(-([1-9]\d*\.\ d*|0\.\d*[1-9]\d*))|0?\.0+|0$
17 Positive floating point number: ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ or ^(([0-9]+\.[0- 9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9] *[1-9][0-9]*))$
18 Negative floating point number: ^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ or ^(-(([0-9]+ \.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|( [0-9]*[1-9][0-9]*)))$
19 Floating point number: ^(-?\d+)(\.\d+)?$ or ^-?([1-9]\d*\.\d*|0\.\d*[1-9]\ d*|0?\.0+|0)$
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn