#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "[\[\(<](?:no|NO|yes|YES)[\/,](?:yes|YES|no|NO)[>\)\]]"
Local $sString = "This operation bla bla bla..." & @CRLF & _
"" & @CRLF & _
"// Closing marks" & @CRLF & _
"Confirm this command? [YES,no]" & @CRLF & _
"Confirm this command? (YES,no)" & @CRLF & _
"Confirm this command? <YES,no>" & @CRLF & _
"" & @CRLF & _
"// YES,NO" & @CRLF & _
"Confirm this command? [YES,no]" & @CRLF & _
"Confirm this command? [yes,NO]" & @CRLF & _
"Confirm this command? [yes,no]" & @CRLF & _
"// YES/NO" & @CRLF & _
"Confirm this command? [YES/no]" & @CRLF & _
"Confirm this command? [yes/NO]" & @CRLF & _
"Confirm this command? [yes/no]" & @CRLF & _
"" & @CRLF & _
"// NO,YES" & @CRLF & _
"Confirm this command? [no,YES]" & @CRLF & _
"Confirm this command? [NO,yes]" & @CRLF & _
"Confirm this command? [no,yes]" & @CRLF & _
"// NO/YES" & @CRLF & _
"Confirm this command? [no/YES]" & @CRLF & _
"Confirm this command? [NO/yes]" & @CRLF & _
"Confirm this command? [no/yes]" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"// DO NOT MATCH" & @CRLF & _
"Confirm this command? [YES,no,cancel]" & @CRLF & _
"Confirm this command? [yes,NO,cancel]" & @CRLF & _
"Confirm this command? [yes,no,CANCEL]" & @CRLF & _
"" & @CRLF & _
"Confirm this command? [YES/no/cancel]" & @CRLF & _
"Confirm this command? [yes/NO/cancel]" & @CRLF & _
"Confirm this command? [yes/no/CANCEL]"
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