#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)((maildir=cipec\.com\.br.*\/)|(clearpasswd.*\,))"
Local $sString = "3-Sep 1 08:40:59 srvmail authdaemond: password matches successfully" & @CRLF & _
"4-Sep 1 08:40:59 srvmail authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=helio@cipec.com.br, fullname=<null>, maildir=cipec.com.br/helio/, quota=<null>, options=<null>" & @CRLF & _
"5:Sep 1 08:40:59 srvmail authdaemond: authmysql: clearpasswd=<null>, passwd=pdsPDnYTP3gyw" & @CRLF & _
"6-Sep 1 08:40:59 srvmail authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=helio@cipec.com.br, fullname=<null>, maildir=cipec.com.br/helio/, quota=<null>, options=<null>" & @CRLF & _
"7:Sep 1 08:40:59 srvmail authdaemond: Authenticated: clearpasswd=hel733, passwd=pdsPDnYTP3gyw" & @CRLF & _
"8-Sep 1 08:40:59 srvmail pop3d: LOGIN, user=helio@cipec.com.br, ip=[::ffff:10.0.1.103], port=[46999]" & @CRLF & _
"9-Sep 1 08:40:59 srvmail pop3d: LOGOUT, user=helio@cipec.com.br, ip=[::ffff:10.0.1.103], port=[46999], top=0, retr=0, rcvd=12, sent=39, time=0" & @CRLF & _
"--" & @CRLF & _
"42-Sep 1 08:41:02 srvmail authdaemond: password matches successfully" & @CRLF & _
"43-Sep 1 08:41:02 srvmail authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=antonio@cipec.com.br, fullname=<null>, maildir=cipec.com.br/antonio/, quota=<null>, options=<null>" & @CRLF & _
"44:Sep 1 08:41:02 srvmail authdaemond: authmysql: clearpasswd=<null>, passwd=pdiHUG4qjaDnI" & @CRLF & _
"45-Sep 1 08:41:02 srvmail authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=antonio@cipec.com.br, fullname=<null>, maildir=cipec.com.br/antonio/, quota=<null>, options=<null>" & @CRLF & _
"46:Sep 1 08:41:02 srvmail authdaemond: Authenticated: clearpasswd=ant527, passwd=pdiHUG4qjaDnI" & @CRLF & _
"47-Sep 1 08:41:02 srvmail pop3d: LOGIN, user=antonio@cipec.com.br, ip=[::ffff:10.0.1.103], port=[47004]" & @CRLF & _
"48-Sep 1 08:41:02 srvmail postgrey[1708]: action=pass, reason=client AWL, client_name=cipec.com.br, client_address=201.48.59.65, sender=return@bonustelecom.com.br, recipient=bianca@cipec.com.br" & @CRLF & _
"--" & @CRLF & _
"73-Sep 1 08:41:04 srvmail authdaemond: password matches successfully" & @CRLF & _
"74-Sep 1 08:41:04 srvmail authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=davi@cipec.com.br, fullname=<null>, maildir=cipec.com.br/davi/, quota=<null>, options=<null>" & @CRLF & _
"75:Sep 1 08:41:04 srvmail authdaemond: authmysql: clearpasswd=<null>, passwd=u3WErgO7RPtDc" & @CRLF & _
"76-Sep 1 08:41:04 srvmail authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/home/vmail, address=davi@cipec.com.br, fullname=<null>, maildir=cipec.com.br/davi/, quota=<null>, options=<null>" & @CRLF & _
"77:Sep 1 08:41:04 srvmail authdaemond: Authenticated: clearpasswd=dav510, passwd=u3WErgO7RPtDc" & @CRLF & _
"78-Sep 1 08:41:04 srvmail pop3d: LOGIN, user=davi@cipec.com.br, ip=[::ffff:10.0.1.103], port=[47017]" & @CRLF & _
"79-Sep 1 08:41:04 srvmail pop3d: LOGOUT, user=davi@cipec.com.br, ip=[::ffff:10.0.1.103], port=[47017], top=0, retr=0, rcvd=12, sent=39, time=0" & @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