#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?=(?!(.)\1)([^\DO:105-93+30])(?-1)(?<!\d(?<=4))).[^\WHY?]$"
Local $sString = "┌──────────────────────────────┐" & @CRLF & _
"│ What is the Meaning of Life? │" & @CRLF & _
"│ Potential Answers │" & @CRLF & _
"└──────────────────────────────┘" & @CRLF & _
"" & @CRLF & _
"Dear regex, please pick one of the following lines." & @CRLF & _
"" & @CRLF & _
"---" & @CRLF & _
"" & @CRLF & _
"The meaning of life, according to the Oxford English Dictionary, is the condition or attribute of living or being alive." & @CRLF & _
"Why should life have a meaning? What a stupid question." & @CRLF & _
"42" & @CRLF & _
"Meaning of life has to be qualified. The meaning of your life to you is not the same as the meaning of your life to a dictator. And what about the meaning of a bee's life, or of a bacteria's life. In other words, see the two previous answers, which can be summarized by 'what a stupid question.'" & @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