mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-11 00:31:31 -04:00
Magic now understands an output regex
This commit is contained in:
parent
f73b374786
commit
a2ce9853b3
2 changed files with 12 additions and 3 deletions
|
@ -280,10 +280,10 @@ class Magic {
|
||||||
break;
|
break;
|
||||||
case "Output":
|
case "Output":
|
||||||
if(!(new RegExp(op.match, op.flags).test(Utils.arrayBufferToStr(output)))){
|
if(!(new RegExp(op.match, op.flags).test(Utils.arrayBufferToStr(output)))){
|
||||||
if (shouldMatch)
|
if (op.shouldMatch)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (!shouldMatch)
|
if (!op.shouldMatch)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -32,7 +32,16 @@ class DefangIPAddresses extends Operation {
|
||||||
flags: "i",
|
flags: "i",
|
||||||
args: [],
|
args: [],
|
||||||
}
|
}
|
||||||
]);
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
match: "^\\s*(([0-9]{1,3}\\[\\.\\]){3}[0-9]{1,3}|([0-9a-f]{4}\\[\\:\\]){7}[0-9a-f]{4})\\s*$",
|
||||||
|
flags: "i",
|
||||||
|
shouldMatch: true,
|
||||||
|
args: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue