#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\d+\.\d+\.\d+\.\d+)\s+([\w\-]+)\s+([\w\-]+)\s+(\w+)\s+(\d+)\s+"
Local $sString = "####################################################################################" & @CRLF & _
"# <IP-Address> <ServiceType> <ServiceName> <MaxMemory> <Port>" & @CRLF & _
"####################################################################################" & @CRLF & _
"#192.168.122.225 database database 1024M " & @CRLF & _
"#192.168.122.226 database database 1024M " & @CRLF & _
"192.168.122.253 database database 1024M" & @CRLF & _
"## MCng BackEnd ServicesG" & @CRLF & _
"#192.168.122.125 amqs activemq 1024M" & @CRLF & _
"#" & @CRLF & _
"# <IP-Address> <ServiceType> <ServiceName> <MaxMemory> <JMXPort> <WebPort> #" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"#" & @CRLF & _
"192.168.122.125 csm csm 2048M 12000" & @CRLF & _
"192.168.122.125 clog clog 1024M 12001" & @CRLF & _
"192.168.122.146 sec " & @CRLF & _
"192.168.122.105 dtu-ds dtu-ds01 4096M 12004 "
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