#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^molecule\/default\/tests\/test_default\.py\s\.\s*\[?(\d+)\%\]$"
Local $sString = "============================= test session starts ==============================" & @CRLF & _
"platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0" & @CRLF & _
"rootdir: /" & @CRLF & _
"plugins: testinfra-6.5.0" & @CRLF & _
"collected 1 item" & @CRLF & _
"molecule/default/tests/test_default.py . [100%]" & @CRLF & _
"============================== 1 passed in 37.81s ==============================" & @CRLF & _
"INFO Verifier completed successfully." & @CRLF & _
"INFO Running default > cleanup" & @CRLF & _
"Molecule default > cleanup" & @CRLF & _
"00:00" & @CRLF & _
"WARNING Skipping, cleanup playbook not configured." & @CRLF & _
"INFO Running default > destroy" & @CRLF & _
"Molecule default > destroy"
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