帮忙望看这2个正整数的表达式一样吗

WBOY
Release: 2016-06-13 12:25:50
Original
771 people have browsed it

帮忙看看这2个正整数的表达式一样吗
/^[1-9]+$/

/^[1-9]*[1-9][0-9]*$/

这有区别么?

目的只是排除负数和0的正整数  只能是整数
------解决思路----------------------
第一个不允许有 0
第二个允许有 0
你说他们一样吗?
------解决思路----------------------
第一个都是1-9的数字
第二个尾数有可能是0的数字
------解决思路----------------------
第一个不许有0
第二个第一位数字不许是0

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!