#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?mx)" & @CRLF & _
"( # the 1st capture group will contain this sequence" & @CRLF & _
"1 # this sequence should begin with 1" & @CRLF & _
"(?=(?:[01]{6,19}) # let's see that there are enough 0s and 1s in a line" & @CRLF & _
" (.*$)) # the 2nd capture group will contain all characters to the end of a line" & @CRLF & _
"(?:0*1){6}) # there must be six more 1s in the sequence" & @CRLF & _
"(?=.{0,13} # complement the 1st capture group to 20 characters" & @CRLF & _
"\2) # the rest of a line should be 2nd capture group"
Local $sString = "0000000" & @CRLF & _
"101010101010111111100000000000001" & @CRLF & _
"00000001100000001110111100000000000000000000000000000000000000000000000000110000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100" & @CRLF & _
"1111111" & @CRLF & _
"111111"
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