i want to extract the last domain from mx record dns , so all fine , but when i use Parse Block Or RegexReplace Block i can’t get match with it.
This is the demo of the working regex
SOURCE :
BLOCK:ShellCommand
executable = "C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe"
arguments = "nslookup -type=mx google.com"
=> VAR @shellCommandOutput
ENDBLOCK
//////// METHODE 1
BLOCK:Parse
input = @shellCommandOutput
pattern = "(?:\\.|[\\W]+)([\\w]+|[\\w]+\\.[\\w]{2,3})(\\.[\\w]{2,3})$"
outputFormat = "[1][2]"
multiLine = True
RECURSIVE
MODE:Regex
=> VAR @HOST
ENDBLOCK
//////// METHODE 2
BLOCK:RegexReplace
original = @shellCommandOutput
pattern = "(?:\\.|[\\W]+)([\\w]+|[\\w]+\\.[\\w]{2,3})(\\.[\\w]{2,3})$"
replacement = "$1$2"
=> VAR @regexReplaceOutput
ENDBLOCK