#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\$([a-z0-9-]+):\s+(.[^;]{3,6}\s*(!default)?);"
Local $sString = "" & @CRLF & _
"$color-white: #ffffff !default;" & @CRLF & _
"$color-black: #000000 !default;" & @CRLF & _
"" & @CRLF & _
"$color-gray-lightest: #f5f5f5 !default;" & @CRLF & _
"$color-gray-lighter: #ededed !default;" & @CRLF & _
"$color-gray-light: #e5e3e3 !default;" & @CRLF & _
"$color-gray-mid: #d1d0d0 !default;" & @CRLF & _
"$color-gray-dark: #a3a2a2 !default;" & @CRLF & _
"$color-gray-darker: #636363 !default;" & @CRLF & _
"" & @CRLF & _
"$color-error: #ff0000;" & @CRLF & _
"$color-success: #2cfba5;" & @CRLF & _
"" & @CRLF & _
"$color-brand-group-1-lighter: #f8d9dd !default;" & @CRLF & _
"$color-brand-group-1-light: #de9193 !default;" & @CRLF & _
"$color-brand-group-1: #be2428 !default;" & @CRLF & _
"" & @CRLF & _
"$color-brand-group-2-lightest: #f3f3f3 !default;" & @CRLF & _
"$color-brand-group-2-lighter: #8e97ae !default;" & @CRLF & _
"$color-brand-group-2-light: #77839d !default;" & @CRLF & _
"$color-brand-group-2: #1d305d !default;" & @CRLF & _
"$color-brand-group-2-dark: #0a1c42 !default;" & @CRLF & _
"" & @CRLF & _
"$color-brand-group-3-light: #84d7b6 !default;" & @CRLF & _
"$color-brand-group-3: #0faf6d !default;" & @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