I Need Help With complex regex in multiple lines with regex options

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
1 Like

If thats not working, why not use js or ipy in between the config to do that if its working in those langs

1 Like

Thank You for your feedback dude , but i don’t know how can i use it with js or ipy !

i want to use it with Loliscript or in pure c# !

i think, there is an issue in Regex structure or something else.

work fine in C# ! but still not working in OB2

@Ruri

this works fine on OB2 i just tested it

1 Like

Thank you dude The issue from My Edited Rurilib Library , the issue fixed !