#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)^(?=\S{8,20}$)(?=\D*\d)(?![0-9_]).{6,18}?(.)\1$"
Local $sString = "+234567899" & @CRLF & _
"a_1de*Gg" & @CRLF & _
"xy1Me*__" & @CRLF & _
"!41deF_hij2lMnopq3ss" & @CRLF & _
"C234567890123$^67800" & @CRLF & _
"*5555555" & @CRLF & _
"sDF564zer""" & @CRLF & _
"!!!!!!!!!4!!!!!!!!!!" & @CRLF & _
"abcdefghijklmnopq9ss" & @CRLF & _
"a_1+Eff" & @CRLF & _
"B41def_hIJ2lmnopq3stt" & @CRLF & _
"abCDefghijklmnopqrss5" & @CRLF & _
"A_4 e*gg" & @CRLF & _
"__1+Eff" & @CRLF & _
"841DEf_hij2lmnopq3stt" & @CRLF & _
"a_1+eFg" & @CRLF & _
"b41DEf_hij2lmnopq3st" & @CRLF & _
"abCDefghijklmnopqrss" & @CRLF & _
"abcdef+++dF" & @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