#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(counter|histogram)[.]_*[a-z]+[a-z_0-9]*[.]_*[a-z]+[a-z_0-9]*"
Local $sString = "counter.." & @CRLF & _
"counter. . " & @CRLF & _
"counter.a.b" & @CRLF & _
"counter._._" & @CRLF & _
"counter._a._" & @CRLF & _
"counter._._a" & @CRLF & _
"counter._a._a" & @CRLF & _
"counter._1._1" & @CRLF & _
"counter._a1._a1" & @CRLF & _
"counter.system.crashes" & @CRLF & _
"counter.system_server.crashes" & @CRLF & _
"counter.system_server2.crashes_" & @CRLF & _
"counter.system_server2._crashes_" & @CRLF & _
"counter.system_server2._crashes_1" & @CRLF & _
"counter.system_server2._crashes_2" & @CRLF & _
"counter.2system_server.2crashes" & @CRLF & _
"counter.2system_server.crashes2" & @CRLF & _
"counter.system_server.crashes_2" & @CRLF & _
"counter.system_server._crashes_2" & @CRLF & _
"counter.system_server.2_crashes_2" & @CRLF & _
"counter.scheduler.jobs_delayed" & @CRLF & _
"counter.scheduler.jobs_delayed2" & @CRLF & _
"counter.scheduler_.jobs_delayed_" & @CRLF & _
"counter.scheduler._jobs_delayed_" & @CRLF & _
"counter.scheduler.jobs_delayed_" & @CRLF & _
"histogram.scheduler.jobs_delayed"
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