mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
feat: 新增"匹配中文汉字和中文标点"
This commit is contained in:
parent
c4b961531c
commit
574bbf8d8e
@ -4,6 +4,7 @@
|
||||
"displayName": "any-rule",
|
||||
"description": "你要的\"正则\"都在这!",
|
||||
"version": "0.3.13",
|
||||
"keywords": ["vscode","typescript", "regxp", "正则"],
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-push": "npm run test:rules"
|
||||
@ -25,6 +26,7 @@
|
||||
"vscode": "^1.12.0"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets",
|
||||
"Other"
|
||||
],
|
||||
"icon": "images/vscode-logo.png",
|
||||
|
11
packages/www/src/RULES.js
vendored
11
packages/www/src/RULES.js
vendored
@ -254,8 +254,8 @@ module.exports = [{
|
||||
examples: ['0.0', '0.09']
|
||||
},
|
||||
{
|
||||
title: '数字',
|
||||
rule: /^\d{1,}$/,
|
||||
title: '只包含数字',
|
||||
rule: /^\d+$/,
|
||||
examples: [12345678]
|
||||
},
|
||||
{
|
||||
@ -263,6 +263,13 @@ module.exports = [{
|
||||
rule: /<(\w+)[^>]*>(.*?<\/\1>)?/,
|
||||
examples: ['<div id="app"> 2333 </div>', '<input type="text">', '<br>']
|
||||
},
|
||||
|
||||
{
|
||||
title: '匹配中文汉字和中文标点',
|
||||
rule: /[\u4e00-\u9fa5|\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/,
|
||||
examples: ["匹配中文汉字以及中文标点符号 。 ? ! , 、 ; : “ ” ‘ ' ( ) 《 》 〈 〉 【 】 『 』 「 」 ﹃ ﹄ 〔 〕 … — ~ ﹏ ¥"]
|
||||
},
|
||||
|
||||
{
|
||||
title: 'qq号格式正确',
|
||||
rule: /^[1-9][0-9]{4,10}$/,
|
||||
|
Loading…
x
Reference in New Issue
Block a user