mirror of
https://github.com/gchq/CyberChef.git
synced 2026-01-31 04:31:15 -08:00
implement naive regex for stripping ANSI escape codes
This commit is contained in:
parent
0bda70bac3
commit
dbce8020f1
1 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
import Operation from "../Operation.mjs";
|
||||
import OperationError from "../errors/OperationError.mjs";
|
||||
|
||||
/**
|
||||
* Remove ANSI Escape Codes operation
|
||||
|
|
@ -33,7 +32,8 @@ class RemoveANSIEscapeCodes extends Operation {
|
|||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
throw new OperationError("Test");
|
||||
const ansiRegex = /(?:\x1B|\\x1b|\\033|\\u001b)\[[0-?]*[ -/]*[@-~]/g;
|
||||
return input.replace(ansiRegex, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue