#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\w+\s+\d+\s+\d{2}(?::\d{2}){2}\s+(?P<devicename1>\S+)"
Local $sString = "Nov 1 00:00:21 akdcs20.ftc.abcd-ipsn AKDCS20 fpc0 LBCM-L2,brcm_port_learning_config(),1258:(brcm_port_learning_config:1258) Setting L2 learning unit:0,port_num:44, learn_flg 5 " & @CRLF & _
"" & @CRLF & _
"Nov 1 01:27:16 spnztpm01.abcd-ipsn 553177: LC/0/0/CPU0:Nov 1 01:27:16.040 : ifmgr[200]: %PKT_INFRA-LINEPROTO-5-UPDOWN : Line protocol on Interface TenGigE0/0/0/1.172153, changed state to Up " & @CRLF & _
" " & @CRLF & _
"Oct 31 23:59:56 akdcs19.ftc.abcd-ipsn AKDCS19 ufdd[1679]: ufd_group_config_if_lookup ifname ae4 "
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