#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\.(_)?[a-z]+-[a-z0-9-]+((_{2}|-{2})?[a-z0-9-]+)?(-{2}[a-z0-9-]+)?[a-z0-9]$"
Local $sString = ".o-layout" & @CRLF & _
"" & @CRLF & _
".c-btn--" & @CRLF & _
"" & @CRLF & _
".o-layout__item" & @CRLF & _
"" & @CRLF & _
".has-dropDown" & @CRLF & _
"" & @CRLF & _
".o-layout--fixed" & @CRLF & _
"" & @CRLF & _
".u-color-primary" & @CRLF & _
"" & @CRLF & _
".foo_bar" & @CRLF & _
"" & @CRLF & _
".s-cms-content" & @CRLF & _
"" & @CRLF & _
".title__sub" & @CRLF & _
"" & @CRLF & _
".t-light" & @CRLF & _
"" & @CRLF & _
".c-date-picker__calendar" & @CRLF & _
"" & @CRLF & _
".heading" & @CRLF & _
"" & @CRLF & _
".o-matrix__item--full" & @CRLF & _
"" & @CRLF & _
"._c-footer__copyright"
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