#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)(?<=:).*?(?=(?:\r?\n)+[^\n]*$)"
Local $sString = "This is the title: \ titles always have a colon" & @CRLF & _
"This is a regular sentence." & @CRLF & _
"A sentence always ends with a period." & @CRLF & _
"A sentence can" & @CRLF & _
"span multiple lines." & @CRLF & _
"A sentence can contain numbers like 123." & @CRLF & _
"The phrase can also contain "text enclosed in double quotes" or 'text enclosed in single quotes'." & @CRLF & _
"Other symbols that may appear in sentences are" & @CRLF & _
"the comma ," & @CRLF & _
"the semicolon ;" & @CRLF & _
"the dollar sign $" & @CRLF & _
"parentheses ( )" & @CRLF & _
"the plus sign + the minus sign - and the square brackets[ ]." & @CRLF & _
"" & @CRLF & _
"This is an isolated phrase that the regular expression should not match."
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