From 97866c38691e268e310800367f6798c6e346612f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=81=E5=AE=81?= <383514580@qq.com> Date: Mon, 9 Mar 2020 23:49:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=96=B0=E5=A2=9E'linux"=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=96=87=E4=BB=B6"=E8=B7=AF=E5=BE=84'(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- packages/www/src/RULES.js | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b34d60f..04f443f 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,14 @@ vscode应用商店中搜索"**any-rule**". /^(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/ ``` -### linux"文件夹"路径 +### linux"隐藏文件"路径 ```javascript -/^(\/[^/]+)+\/?$/ +/^\/(?:[^/]+\/)*\.[^/]*/ ``` -### linux"文件"路径 +### linux"文件(夹)"路径 ```javascript -/^(\/[^/]+)+$/ +/^\/[\s\S]+/ ``` ### window"文件夹"路径 diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index c31f78b..add66cc 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -49,14 +49,14 @@ module.exports = [{ examples: ['255.255.255.0', '255.224.0.0'] }, { - title: 'linux"文件夹"路径', - rule: /^(\/[^/]+)+\/?$/, - examples: ['/usr/ad/dd', '/root/','/.gitignore'] + title: 'linux"隐藏文件"路径', + rule: /^\/(?:[^/]+\/)*\.[^/]*/, + examples: ['/usr/ad/.dd', '/root/.gitignore', '/.gitignore'] }, { - title: 'linux"文件"路径', - rule: /^(\/[^/]+)+$/, - examples: ['/usr/ad/dd/a.js', '/root/b.ts'] + title: 'linux"文件(夹)"路径', + rule: /^\/[\s\S]+/, + examples: ['/usr/ad/dd/', '/root/b.ts','/root/abc'] }, { title: 'window"文件夹"路径', @@ -310,4 +310,4 @@ module.exports = [{ rule: /^([a-zA-Z_][a-zA-Z0-9_]*)+([.][a-zA-Z_][a-zA-Z0-9_]*)+$/, examples: ['com.bbb.name'] } -]; +]; \ No newline at end of file