#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?=(.*\n){3}Ethernet Interface)[\w\W]+(?=IfIndex)"
Local $sString = "Tue Oct 0 00:00:00 UTC 0000" & @CRLF & _
"A:REDACTED# REDACTED 7/1/8 " & @CRLF & _
"" & @CRLF & _
"==============================================================" & @CRLF & _
"Ethernet Interface" & @CRLF & _
"===============================================================" & @CRLF & _
"Description : REDACTED" & @CRLF & _
"Interface : 0/0/0 Oper Speed : 10 Gbps" & @CRLF & _
"Link-level : Ethernet Config Speed : N/A" & @CRLF & _
"Admin State : up Oper Duplex : full" & @CRLF & _
"Oper State : up Config Duplex : N/A" & @CRLF & _
"Physical Link : Yes MTU : 2004" & @CRLF & _
"Single Fiber Mode : No Min Frame Length : 64 Bytes" & @CRLF & _
"IfIndex : REDACTED Hold time up : 90 seconds"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm