#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)BEGIN:VNOTE[\S\s]+?PRINTABLE:([\S\s]+?)D(CREATED:[\S\s]+?)T[\S\s]+?LAST-MODIFIED[\S\s]+?END:VNOTE"
Local $sString = "BEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Extracting text from a file is a common task in scripting and programming" & @CRLF & _
"DCREATED:20180304T203529" & @CRLF & _
"LAST-MODIFIED:20180304T203529" & @CRLF & _
"END:VNOTEBEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Most systems come pre-installed with Python" & @CRLF & _
"DCREATED:20190406T112342" & @CRLF & _
"LAST-MODIFIED:20190406T112342" & @CRLF & _
"END:VNOTEBEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:On Linux and macOS, the command to run the Python 3 interpreter is python3." & @CRLF & _
"DCREATED:20170603T171656" & @CRLF & _
"LAST-MODIFIED:20170607T174906" & @CRLF & _
"END:VNOTEBEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Running Python with a file name will interpret that python program." & @CRLF & _
"DCREATED:20190415T102154" & @CRLF & _
"LAST-MODIFIED:20190808T121123" & @CRLF & _
"END:VNOTEBEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Lorem ipsum dolor sit amet, consectetur adipiscing elit." & @CRLF & _
"" & @CRLF & _
"Mauris nec maximus purus. Maecenas sit amet pretium tellus." & @CRLF & _
"" & @CRLF & _
"Quisque at dignissim lacus." & @CRLF & _
"DCREATED:20190511T110151" & @CRLF & _
"LAST-MODIFIED:20190511T110151" & @CRLF & _
"END:VNOTEBEGIN:VNOTE" & @CRLF & _
"VERSION:1.1" & @CRLF & _
"BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:A Python program can read a text file using the built-in open() function." & @CRLF & _
"DCREATED:20190501T074415" & @CRLF & _
"LAST-MODIFIED:20190511T130424" & @CRLF & _
"END:VNOTE"
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