Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 正则表达式-接受15到17位数字_Regex - Fatal编程技术网

Regex 正则表达式-接受15到17位数字

Regex 正则表达式-接受15到17位数字,regex,Regex,我想要一个只接受15到17位数字的正则表达式。^\d{15,17}$-用于任何数字(使用[0-9]而不是\d,以避免使用Unicode字符,如果适用)。 ^[1-9]\d{14,16}$-如果不希望数字以全零开头 当然,解析数字并检查它可能更容易,它非常适合long值

我想要一个只接受15到17位数字的正则表达式。

^\d{15,17}$
-用于任何数字(使用
[0-9]
而不是
\d
,以避免使用Unicode字符,如果适用)。
^[1-9]\d{14,16}$
-如果不希望数字以全零开头

当然,解析数字并检查它可能更容易,它非常适合
long