#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)[^[:print:]]\[[^a-zA-Z]*[a-zA-Z]"
Local $sString = "[BEGIN TYPESCRIPT]" & @CRLF & _
"[H[JLinux dcim-mao 4.19.0-20-cloud-amd64 #1 SMP Debian 4.19.235-1 (2022-03-17) x86_64" & @CRLF & _
"" & @CRLF & _
"The programs included with the Debian GNU/Linux system are free software;" & @CRLF & _
"the exact distribution terms for each program are described in the" & @CRLF & _
"individual files in /usr/share/doc/*/copyright." & @CRLF & _
"" & @CRLF & _
"Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent" & @CRLF & _
"permitted by applicable law." & @CRLF & _
"Last login: Mon Jul 10 08:00:55 2023 from 172.17.0.2" & @CRLF & _
"" & @CRLF & _
"[?2004hroot@dcim-mao:~# cd" & @CRLF & _
"[?2004l" & @CRLF & _
"[?2004hroot@dcim-mao:~# ls" & @CRLF & _
"[?2004l" & @CRLF & _
"[?2004hroot@dcim-mao:~# cd /" & @CRLF & _
"[?2004l" & @CRLF & _
"[?2004hroot@dcim-mao:/# ls" & @CRLF & _
"[?2004l" & @CRLF & _
"app etc media public srv usr" & @CRLF & _
"bin home mnt root supervisor.conf var" & @CRLF & _
"boot lib opt run sys" & @CRLF & _
"dev lib64 proc sbin tmp" & @CRLF & _
"[?2004hroot@dcim-mao:/# " & @CRLF & _
"[END TYPESCRIPT]"
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