js正则表达式校验数字

const input = '2434.34234'
const grep = /^(\d+)(\.\d+)?$/g;
grep.test(input);

posted @ 2023-07-05 17:13  Bravo_Jack  阅读(15)  评论(0编辑  收藏  举报