#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?=\S{10,})(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[0-9])(?=\S*[!£$%^&\"])(?<!\S)\S{10,20}(?=\s|\Z)"
Local $sString = "Password!123" & @CRLF & _
"Password!123 test test" & @CRLF & _
"test "Password!123" test test" & @CRLF & _
"" & @CRLF & _
" 9: Abc!56789" & @CRLF & _
"10: -Ab!567890" & @CRLF & _
"20: -Ab!567890DeF4567890" & @CRLF & _
"21: AbC!567890DeF45678901" & @CRLF & _
"" & @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