#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?P<port_name>[\w\/]+)[^\S\r\n]+(?P<description>(?!Full\b|N\/A\b)\S+(?:[^\S\r\n]+\S+)*?[^\S\r\n]+)?(?P<duplex>Full|N\/A)[^\S\r\n]+(?P<speed>\d+|N\/A)\b"
Local $sString = "Port Description Duplex Speed Neg Link Flow M VLAN" & @CRLF & _
" State Ctrl" & @CRLF & _
"--------- --------------- ------ ------- ---- ------ ----- -- -------------------" & @CRLF & _
"Te1/0/1 CVH10 Mgt+Clstr Full 10000 Off Up On T (1),161-163" & @CRLF & _
"Te1/0/2 CVH10 VM 1 Full 10000 Off Up On T (1),11,101,110," & @CRLF & _
" 120,130,140,150," & @CRLF & _
" 160,170,180,190," & @CRLF & _
" 200,210,230,240," & @CRLF & _
" 250,666,999" & @CRLF & _
"Fo2/1/1 N/A N/A N/A Detach N/A" & @CRLF & _
"Te2/0/8 Full 10000 Off Down Off A 1"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; 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