diff --git a/src/core/config/OperationConfig.js b/src/core/config/OperationConfig.js index 08c18d25..c5b9dd27 100755 --- a/src/core/config/OperationConfig.js +++ b/src/core/config/OperationConfig.js @@ -2322,12 +2322,27 @@ const OperationConfig = { { name: "Case insensitive", type: "boolean", - value: Regex.REGEX_CASE_INSENSITIVE + value: true }, { - name: "Multiline matching", + name: "^ and $ match at newlines", type: "boolean", - value: Regex.REGEX_MULTILINE_MATCHING + value: true + }, + { + name: "Dot matches all", + type: "boolean", + value: false + }, + { + name: "Unicode support", + type: "boolean", + value: false + }, + { + name: "Astral support", + type: "boolean", + value: false }, { name: "Display total", diff --git a/src/core/operations/Regex.js b/src/core/operations/Regex.js index 5cb374d1..9c6b2f8e 100644 --- a/src/core/operations/Regex.js +++ b/src/core/operations/Regex.js @@ -71,16 +71,6 @@ const Regex = { value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}" }, ], - /** - * @constant - * @default - */ - REGEX_CASE_INSENSITIVE: true, - /** - * @constant - * @default - */ - REGEX_MULTILINE_MATCHING: true, /** * @constant * @default @@ -100,15 +90,21 @@ const Regex = { * @returns {html} */ runRegex: function(input, args) { - let userRegex = args[1], + const userRegex = args[1], i = args[2], m = args[3], - displayTotal = args[4], - outputFormat = args[5], - modifiers = "g"; + s = args[4], + u = args[5], + a = args[6], + displayTotal = args[7], + outputFormat = args[8]; + let modifiers = "g"; if (i) modifiers += "i"; if (m) modifiers += "m"; + if (s) modifiers += "s"; + if (u) modifiers += "u"; + if (a) modifiers += "A"; if (userRegex && userRegex !== "^" && userRegex !== "$") { try { @@ -275,7 +271,7 @@ const Regex = { if (displayTotal) output = "Total found: " + total + "\n\n" + output; - return output; + return output.slice(0, -1); }, }; diff --git a/test/index.js b/test/index.js index 5c397dea..e58d7e20 100644 --- a/test/index.js +++ b/test/index.js @@ -30,6 +30,7 @@ import "./tests/operations/MS.js"; import "./tests/operations/PHP.js"; import "./tests/operations/NetBIOS.js"; import "./tests/operations/OTP.js"; +import "./tests/operations/Regex.js"; import "./tests/operations/StrUtils.js"; import "./tests/operations/SeqUtils.js"; diff --git a/test/tests/operations/StrUtils.js b/test/tests/operations/StrUtils.js index 6e66b266..8110d067 100644 --- a/test/tests/operations/StrUtils.js +++ b/test/tests/operations/StrUtils.js @@ -8,21 +8,6 @@ import TestRegister from "../../TestRegister.js"; TestRegister.addTests([ - { - name: "Regex, non-HTML op", - input: "/<>", - expectedOutput: "/<>", - recipeConfig: [ - { - "op": "Regular expression", - "args": ["User defined", "", true, true, false, "Highlight matches"] - }, - { - "op": "Remove whitespace", - "args": [true, true, true, true, true, false] - } - ], - }, { name: "Diff, basic usage", input: "testing23\n\ntesting123",