Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeNote #19

Open
xiaotiandada opened this issue Jan 19, 2021 · 0 comments
Open

CodeNote #19

xiaotiandada opened this issue Jan 19, 2021 · 0 comments

Comments

@xiaotiandada
Copy link
Owner

2019-04-14 16:49:16

正则

// 判断字符串是否为数字
reg = /^[0-9]*$/;

// 判断字符串是否为数字 开头为1-9
reg = /^\+?[1-9][0-9]*$/;
reg.test('12323123123213213213')

// 小数点后三位 如果后面需要解除限制修改正则  {0,3}
value.match(/^\d*(\.?\d{0,3})/g)[0] || null;

正则表达式 - 语法
正则表达式在线测试 常用正则表达式

记录一些 CodeNote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant