当前位置:网站首页>[verification] only numbers (positive and negative numbers) can be entered
[verification] only numbers (positive and negative numbers) can be entered
2022-07-24 18:11:00 【Solution without encirclement】
var validate = (rule, val, callback) => {
if (!val) {
callback(new Error(' Please enter '))
} else {
const reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/
if (reg.test(val)) {
return callback()
} else {
callback(new Error(' Input format error '))
}
}
}Enter positive and negative numbers
边栏推荐
- 700. Search DFS method in binary search tree
- es(1)
- Single cell code analysis - gynecological cancer single cell transcriptome and chromatin accessibility analysis 1
- 单细胞代码解析-妇科癌症单细胞转录组及染色质可及性分析1
- How to read "STL source code analysis"?
- 关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行
- [OBS] dependency Library: x264 vs Build
- 猜JWT关键字
- Win10 super good-looking mouse theme, you also try it
- In depth analysis of the famous Alibaba cloud log4j vulnerability
猜你喜欢

Definition and storage of adjacency table and adjacency storage of directed graph and undirected graph

es(1)

Stream, file, IO
去不图床容量兑换

Laravel notes - RSA encryption of user login password (improve system security)

Common methods of number and math classes

使用Prometheus+Grafana监控MySQL性能指标

C language custom type explanation - structure

T245982 "kdoi-01" drunken flower Yin

PXE efficient batch network installation
随机推荐
Alibaba /166 obtains the API instructions for all products in the store
0613 ~ self study
0630~职业素养课
Wu Enda writes: how to establish projects to adapt to AI career
JumpServer的使用
The solution of single chip microcomputer not supporting printf floating point type
Int8 & int8, have you ever stumbled like this?
steam API
继承与派生
Brats18 - Multimodal MR image brain tumor segmentation challenge continued
Read zepto source code touch module
[leetcode] 30. Concatenate substrings of all words
com.mysql.cj.jdbc.exceptions. MySQLTransactionRollbackException: Deadlock found when trying to get lo
Codeforces Round #794 (Div. 2)(A.B.C)
700. Search DFS method in binary search tree
Example of single table query in ORM student management system
Simple test JS code
T245982 「KDOI-01」醉花阴
Laravel笔记-用户登录时密码进行RSA加密(提高系统安全性)
What are the pitfalls from single architecture to distributed architecture?