Compare commits

...

2 Commits

Author SHA1 Message Date
muwoo
e128d01b81
Merge pull request #184 from qidian99/master
Fix regex match error
2024-06-12 13:52:04 +08:00
Dian Qi
472879f9b2 Fix format regex error that will match all inputs 2023-06-04 20:30:06 +08:00

View File

@ -8,7 +8,7 @@ import useFocus from './clipboardWatch';
function formatReg(regStr) {
const flags = regStr.replace(/.*\/([gimy]*)$/, '$1');
const pattern = flags.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
const pattern = regStr.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
return new RegExp(pattern, flags);
}