#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)age [0-9]*.\n(.*)"
Local $sString = "Born Elon Reeve Musk" & @CRLF & _
"June 28, 1971 (age 50)" & @CRLF & _
"Pretoria, Transvaal, South Africa" & @CRLF & _
"Citizenship " & @CRLF & _
"South Africa (1971–present)" & @CRLF & _
"Canada (1971–present)" & @CRLF & _
"United States (2002–present)" & @CRLF & _
"Education University of Pennsylvania (BS, BA)" & @CRLF & _
"Title " & @CRLF & _
"Founder, CEO and Chief Engineer of SpaceX" & @CRLF & _
"CEO and product architect of Tesla, Inc." & @CRLF & _
"Founder of The Boring Company and X.com (now part of PayPal)" & @CRLF & _
"Co-founder of Neuralink, OpenAI, and Zip2" & @CRLF & _
"Spouse(s) " & @CRLF & _
"Justine Wilson" & @CRLF & _
"" & @CRLF & _
"(m. 2000; div. 2008)" & @CRLF & _
"Talulah Riley" & @CRLF & _
"" & @CRLF & _
"(m. 2010; div. 2012)" & @CRLF & _
"" & @CRLF & _
"(m. 2013; div. 2016)" & @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