mirror of
https://github.com/gchq/CyberChef.git
synced 2024-09-28 06:21:30 +02:00
Tidied up Case Insensitive Regex ops
This commit is contained in:
parent
62edd76d7e
commit
bf0bd620f1
@ -1,10 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* @author masq [github.cyberchef@masq.cc]
|
* @author masq [github.cyberchef@masq.cc]
|
||||||
|
* @author n1073645
|
||||||
* @copyright Crown Copyright 2018
|
* @copyright Crown Copyright 2018
|
||||||
* @license Apache-2.0
|
* @license Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To Case Insensitive Regex operation
|
* To Case Insensitive Regex operation
|
||||||
@ -54,7 +56,7 @@ class ToCaseInsensitiveRegex extends Operation {
|
|||||||
try {
|
try {
|
||||||
RegExp(input);
|
RegExp(input);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return "Invalid Regular Expression (Please note this version of node does not support look behinds).";
|
throw new OperationError("Invalid Regular Expression (Please note this version of node does not support look behinds).");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example: [test] -> [[tT][eE][sS][tT]]
|
// Example: [test] -> [[tT][eE][sS][tT]]
|
||||||
|
Loading…
Reference in New Issue
Block a user