mirror of
https://github.com/rubickCenter/rubick
synced 2025-10-26 05:51:30 +08:00
Fix format regex error that will match all inputs
This commit is contained in:
@@ -6,7 +6,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user