PHP Regular expression: match a specific number, commonly introduced, hope to have a harvest.
^[1-9]d*$//Match positive integer
^-[1-9]d*$//Match negative integer
^-? [1-9]d*$//Match integer
^[1-9]d*|0$//matches non-negative integers (positive integers 0)
^-[1-9]d*|0$//matches a non-positive integer (negative integer 0)
^[1-9]d*.d*|0.d*[1-9]d*$//Match positive floating point number
^-([1-9]d*.d*|0.d*[1-9]d*) $//Match negative floating point number
^-? ([1-9]d*.d*|0.d*[1-9]d*|0?. 0 |) $//Match floating point number
^[1-9]d*.d*|0.d*[1-9]d*|0?. 0 |0$//matched non-negative floating-point number (positive floating-point number 0)
^ (-([1-9]d*.d*|0.d*[1-9]d*)) | 0 |0$//matching non-positive floating-point number (negative floating-point number 0)
http://www.bkjia.com/PHPjc/486175.html www.bkjia.com true http://www.bkjia.com/PHPjc/486175.html techarticle PHP Regular expression: match a specific number, commonly introduced, hope to have a harvest. ^[1-9]d*$//Match positive integer ^-[1-9]d*$//Match negative integer ^-? [1-9]d*$//Match integer ^[1-9]d*| ...