#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?P<dst_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?,?(?P<User>[a-zA-Z._\d]+),(?P<src_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(?<ID>\d+)"
Local $sString = "OpenVPN CLIENT LIST" & @CRLF & _
"Updated,Thu Nov 11 10:00:15 2021" & @CRLF & _
"20.20.20.20,n.y.f_o_o,2.2.2.2:11111 Thu Nov 11 10:00:14 2021" & @CRLF & _
"10.10.10.10,a.a.foo,3.3.3.3:22222,Thu Nov 11 10:00:14 2021" & @CRLF & _
"Updated,Thu Nov 11 10:00:12 2021" & @CRLF & _
"Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since" & @CRLF & _
"30.30.30.30,t.p.bar,192.168.1.1:58348,Thu Nov 11 10:00:12 2021" & @CRLF & _
"40.40.40.40,test,192.168.1.11:58348,Thu Nov 11 10:00:02 2021" & @CRLF & _
"50.50.50.50,test_2,33.33.33.3:58348,Thu Nov 11 10:00:22 2021"
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