mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Caching added for Magic regexes
This commit is contained in:
parent
570a84b67a
commit
5b5105c864
1 changed files with 4 additions and 5 deletions
|
@ -36,10 +36,10 @@ class Magic {
|
|||
const matches = [];
|
||||
|
||||
for (let i = 0; i < opPatterns.length; i++) {
|
||||
const pattern = opPatterns[i],
|
||||
regex = new RegExp(pattern.match, pattern.flags);
|
||||
const pattern = opPatterns[i];
|
||||
|
||||
if (regex.test(this.inputStr)) {
|
||||
|
||||
if (pattern.match.test(this.inputStr)) {
|
||||
matches.push(pattern);
|
||||
}
|
||||
}
|
||||
|
@ -522,8 +522,7 @@ class Magic {
|
|||
OperationConfig[op].input.regex.forEach(pattern => {
|
||||
opCriteria.regex.push({
|
||||
op: op,
|
||||
match: pattern.match,
|
||||
flags: pattern.flags,
|
||||
match: new RegExp(pattern.match, pattern.flags),
|
||||
args: pattern.args,
|
||||
useful: pattern.useful || false
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue