#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^[\s]*(.*?)[\s]*$"
Local $sString = " Lorem ipsum " & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
" F.F.Coppola " & @CRLF & _
"" & @CRLF & _
" Kilgore : Smell that? You smell that?" & @CRLF & _
" Lance : What?" & @CRLF & _
" Kilgore : Napalm, son. Nothing else in the world smells like that. I love the smell of napalm in the morning. You know, one time we had a hill bombed, for 12 hours. When it was all over, I walked up. We didn't find one of 'em, not one stinkin' dink body." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Robert Duvall as Lieutenant Colonel Bill Kilgore - IMDb"
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