search

Home  >  Q&A  >  body text

正则怎么让输入框只输入正整数?

在一个input框,希望正则验证输入的值只是正整数

phpcn_u391phpcn_u3912882 days ago1675

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:51:37

    How to make the input box only input positive integers with regular expressions? - PHP Chinese website Q&A - How to make the input box only input positive integers with regular expressions? - PHP Chinese website Q&A

    Take a look around and learn.

    reply
    0
  • 阿神

    阿神2017-03-16 14:42:35

    <input type="text" pattern="^[1-9]\d*">


    reply
    0
  • Cancelreply