mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 07:38:58 +08:00
[feat] 新增 浮点数(严格) 正则
This commit is contained in:
parent
03471b0036
commit
5782ee1ddc
@ -1,4 +1,4 @@
|
||||
# 正则大全  [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule)  [](https://circleci.com/gh/any86/any-rule)
|
||||
# 正则大全  [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [](https://marketplace.visualstudio.com/items?itemName=russell.any-rule)  [](https://circleci.com/gh/any86/any-rule)
|
||||
|
||||
🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台
|
||||
|
||||
@ -442,6 +442,11 @@ vscode应用商店中搜索"**any-rule**".
|
||||
/^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9]\d*|0\.0+)$/
|
||||
```
|
||||
|
||||
### 浮点数(严格)
|
||||
```javascript
|
||||
/^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9])$/
|
||||
```
|
||||
|
||||
### email(支持中文邮箱)
|
||||
```javascript
|
||||
/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
|
||||
|
8
packages/www/src/RULES.js
vendored
8
packages/www/src/RULES.js
vendored
@ -394,7 +394,13 @@ module.exports = [{
|
||||
title: '浮点数',
|
||||
rule: /^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9]\d*|0\.0+)$/,
|
||||
examples: ["1.23", "-1.01", "0.00"]
|
||||
// allow "1.23", allow "-0.1", allow "0.00", ban "-0.00", allow "2.0", ban "2."
|
||||
// allow "1.23", allow "-0.1", allow "0.00", ban "-0.00", ban "2.", allow "2.0"
|
||||
},
|
||||
{
|
||||
title: '浮点数(严格)',
|
||||
rule: /^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9])$/,
|
||||
examples: ["1.23", "-1.01"]
|
||||
// allow "1.23", allow "-0.1", ban "2.", ban "2.0"
|
||||
},
|
||||
{
|
||||
title: 'email(支持中文邮箱)',
|
||||
|
Loading…
x
Reference in New Issue
Block a user