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

There are no escape parentheses,Incorrectly matches 新建文件夹 (2) against 新建文件夹 (2) #76

Open
AlanSean opened this issue Mar 3, 2021 · 1 comment

Comments

@AlanSean
Copy link

AlanSean commented Mar 3, 2021

picomatch@^2.2.1
Code:
const picomatch = require('picomatch');
const file1 = 'C:/Users/111/Desktop/新建文件夹 (2)/QQ图片20210204193714.jpg';
const file2 = '新建文件夹()';
const a= picomatch.makeRe(file1,{
dot: false,
matchBase: false,
nobrace: false,
nocase: false,
noext: false,
noglobstar: false,
posix: true,
strictSlashes: false
})
const a2= picomatch.makeRe(file2,{
dot: false,
matchBase: false,
nobrace: false,
nocase: false,
noext: false,
noglobstar: false,
posix: true,
strictSlashes: false
})
a1.test(file1);//false
a2.test(file2);// /^(?:新建文件夹())$/ false
Expected result: true
Actual result: false

@AlanSean AlanSean changed the title There are no escape parentheses,Incorrectly matches [1-5] against [1-5] There are no escape parentheses,Incorrectly matches 新建文件夹 (2) against 新建文件夹 (2) Mar 3, 2021
@AlanSean
Copy link
Author

AlanSean commented Mar 3, 2021

新建文件夹 () => /^(?:^(?:\新\建\文\件\夹\ \(\))$)$/ //yes
新建文件夹 () => /^(?:新建文件夹 ())$/ // no

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