Updated warning now that original issue has been resolved.

This commit is contained in:
gchqdev364 2025-05-12 14:24:07 +00:00
parent e9b182d33b
commit 288cd8f063
2 changed files with 23 additions and 1 deletions

View file

@ -21,7 +21,7 @@ class ExtractIPAddresses extends Operation {
this.name = "Extract IP addresses"; this.name = "Extract IP addresses";
this.module = "Regex"; this.module = "Regex";
this.description = "Extracts all IPv4 and IPv6 addresses.<br><br>Warning: Given a string <code>710.65.0.456</code>, this will match <code>10.65.0.45</code> so always check the original input!"; this.description = "Extracts all IPv4 and IPv6 addresses.<br><br>Warning: Given a string <code>1.2.3.4.5.6.7.8</code>, this will match <code>1.2.3.4 and 5.6.7.8</code> so always check the original input!";
this.inputType = "string"; this.inputType = "string";
this.outputType = "string"; this.outputType = "string";
this.args = [ this.args = [

View file

@ -85,6 +85,28 @@ TestRegister.addTests([
}, },
], ],
}, },
{
name: "ExtractIPAddress silly example",
input: "710.65.0.456",
expectedOutput: "",
recipeConfig: [
{
"op": "Extract IP addresses",
"args": [true, true, false, false, false, false]
},
],
},
{
name: "ExtractIPAddress longer dotted decimal",
input: "1.2.3.4.5.6.7.8",
expectedOutput: "1.2.3.4\n5.6.7.8",
recipeConfig: [
{
"op": "Extract IP addresses",
"args": [true, true, false, false, false, false]
},
],
},
{ {
name: "ExtractIPAddress octal valid", name: "ExtractIPAddress octal valid",
input: "01.01.01.01 0123.0123.0123.0123 0377.0377.0377.0377", input: "01.01.01.01 0123.0123.0123.0123 0377.0377.0377.0377",