#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?sm)^#monfiltreperso3$.+?^#FIN$[\r\n]*"
Local $sString = "#MESSAGE" & @CRLF & _
":0" & @CRLF & _
"* ^(To|cc).*fd.*" & @CRLF & _
"|/usr/bin/vacation fd" & @CRLF & _
"#monfiltreperso" & @CRLF & _
":0" & @CRLF & _
"* ^From.*martial@gironde.comFIN" & @CRLF & _
"Maildir/.repertorymoi" & @CRLF & _
"#FIN" & @CRLF & _
"#monfiltreperso2" & @CRLF & _
":0" & @CRLF & _
"* ^Subject:.*monsujet2" & @CRLF & _
"Maildir/.repertorymoi2" & @CRLF & _
"#FIN" & @CRLF & _
"#monfiltreperso3" & @CRLF & _
":0" & @CRLF & _
"* ^From.*martial2@gironde.com" & @CRLF & _
"Maildir/.repertorymoi2" & @CRLF & _
"#FIN"
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