#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)puppet(.*?)::"
Local $sString = "chocolatey" & @CRLF & _
"pe_install::install" & @CRLF & _
"pe_postgresql::lib::devel" & @CRLF & _
"profile::agent_config" & @CRLF & _
"puppet_agent::install::remove_packages" & @CRLF & _
"puppet_customer::customer_shared::alerts" & @CRLF & _
"puppet_customer::email_shared::email" & @CRLF & _
"puppet_edcs::claims::grt_api" & @CRLF & _
"puppet_enterprise::certs::puppetdb_whitelist" & @CRLF & _
"puppet_ets::windows::defaults::audit_policy" & @CRLF & _
"puppet_metrics_collector" & @CRLF & _
"puppet_policyservicing::owbinet::file_cluster" & @CRLF & _
"puppet_printserver::print" & @CRLF & _
"puppet_product::avrt::avrt" & @CRLF & _
"puppet_quoting::aqw_dca::aqw" & @CRLF & _
"puppet_testing::ourtestfile" & @CRLF & _
"puppet_webpresence::lifelanes_webapp" & @CRLF & _
"role::customer::customer_shared"
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