#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:(?:rgb\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3})\))|(?:rgba\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?([0-1]\.0|0\.[0-9])\)))"
Local $sString = "rgb(0, 0, 0)" & @CRLF & _
"rgb(0,0,0)" & @CRLF & _
"rgb(255, 255, 255)" & @CRLF & _
"rgba(255, 255, 255, 1)" & @CRLF & _
"rgba(255, 255, 255,1)" & @CRLF & _
"rgba(255, 255, 255, 0)" & @CRLF & _
"rgba(255, 255, 255, 0.9)" & @CRLF & _
"rgba(255, 255, 255, 0.0)" & @CRLF & _
"rgba(255, 255, 255, 1.0)" & @CRLF & _
"rgba(255, 255, 255, 1.1)" & @CRLF & _
"rgba(255, 255, 255, 666)" & @CRLF & _
"rgba(255, 255, 255ab)" & @CRLF & _
"rgb(255, 255, 255, 344)" & @CRLF & _
"" & @CRLF & _
"#p1 {background-color: rgba(255, 0, 0, 0.3);} /* red with opacity */" & @CRLF & _
"#p2 {background-color: rgba(0, 255, 0, 0.3);} /* green with opacity */" & @CRLF & _
"#p3 {background-color: rgba(0, 0, 255, 0.3);} /* blue with opacity */"
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