#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?m)(?<=^(\s*)(?:[^\s:][^:\r\n]*)?: \|\s*)(?:\r?\n(?!\1\S).*)+"
Local $sString = "kind: ConfigMap" & @CRLF & _
"apiVersion: v1" & @CRLF & _
"metadata:" & @CRLF & _
" name: {{ .Release.Name }}-nginx-index-html-configmap" & @CRLF & _
"data:" & @CRLF & _
" startRegexMatch.html: |" & @CRLF & _
" <!DOCTYPE html>" & @CRLF & _
" <html>" & @CRLF & _
" <head>" & @CRLF & _
" <title>Up & Running!</title>" & @CRLF & _
" <style>" & @CRLF & _
" body {" & @CRLF & _
" width: 60em;" & @CRLF & _
" margin: 0 auto;" & @CRLF & _
" font-family: Tahoma, Verdana, Arial, sans-serif;" & @CRLF & _
" }" & @CRLF & _
" </style>" & @CRLF & _
" </head>" & @CRLF & _
" <body>" & @CRLF & _
" <h1>Up & Running!</h1>" & @CRLF & _
"" & @CRLF & _
" <pre style="float:left;">" & @CRLF & _
" 888 888 888 d88P 888 8888888P" 8888888P" 888 888 888d88888b888 888 888 8888888P" 8888888b "Y88b. 888" & @CRLF & _
" 8888888888 88888888 "Y8888P" d88P 888 888 T88b 888 T88b "Y88888P" 888P Y888 "Y88888P" 888 T88b 888 Y88b "Y8888P" 888 </pre>" & @CRLF & _
" </body>" & @CRLF & _
" </html>" & @CRLF & _
" stopRegexMatch:"
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