#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[ \S]+?SMTP connection from \S+? \(TCP\/IP connection count = (?!\b1\b|\b2\b|\b3\b)\d+\)"
Local $sString = "2014-11-27 17:09:05 SMTP connection from [42.117.255.244] (TCP/IP connection count = 1)" & @CRLF & _
"" & @CRLF & _
"2014-11-27 17:09:14 SMTP connection from [118.68.249.18] (TCP/IP connection count = 2)" & @CRLF & _
"" & @CRLF & _
"2014-11-27 17:09:15 SMTP connection from [113.188.85.220] (TCP/IP connection count = 3)" & @CRLF & _
"" & @CRLF & _
"2014-11-27 17:09:15 SMTP connection from [113.188.85.220] (TCP/IP connection count = 5)" & @CRLF & _
""
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