Merge pull request #184 from qidian99/master

Fix regex match error
This commit is contained in:
muwoo
2024-06-12 13:52:04 +08:00
committed by GitHub

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);
}