#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)ENV GOSS_VERSION="(?<currentValue>.*)""
Local $sString = "FROM kudobuilder/kuttl:v0.15.0" & @CRLF & _
"" & @CRLF & _
"ENV GOSS_VERSION="v0.3.20"" & @CRLF & _
"ENV KUTTL_VERSION="v0.44.0"" & @CRLF & _
"" & @CRLF & _
"# curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.26.0/bin/linux/amd64/kubectl && \" & @CRLF & _
"# chmod +x ./kubectl && \" & @CRLF & _
"# mv ./kubectl /usr/local/bin/kubectl && \" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"# Pending merge of https://github.com/goss-org/goss/pull/792 and https://github.com/kudobuilder/kuttl/pull/448" & @CRLF & _
"RUN echo "Installing carvel ytt version ${KUTTL_VERSION}" ; \" & @CRLF & _
" curl -L "https://github.com/goss-org/goss/releases/download/${KUTTL_VERSION}/ytt-linux-amd64" -o /usr/local/bin/ytt && \" & @CRLF & _
" chmod +rx /usr/local/bin/ytt && \" & @CRLF & _
" echo "Installing goss and kgoss version ${GOSS_VERSION}" ; \" & @CRLF & _
" curl -L "https://github.com/goss-org/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64" -o /usr/local/bin/goss && \" & @CRLF & _
" chmod +rx /usr/local/bin/goss && \" & @CRLF & _
" curl -LO https://raw.githubusercontent.com/orange-cloudfoundry/goss/kgoss-kubectl-opts/extras/kgoss/kgoss -o /usr/local/bin/kgoss && \" & @CRLF & _
" chmod +rx /usr/local/bin/kgoss && \" & @CRLF & _
" /usr/local/bin/ytt --version && \" & @CRLF & _
" /usr/local/bin/goss -v && \" & @CRLF & _
" /usr/local/bin/kubectl version && \" & @CRLF & _
" /usr/local/bin/kgoss || echo "Installation done."" & @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