#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)\$(?P<type>(?:v|a|s))?(?P<prop>(?:lang|lang2|lang3|language|codec|format|ch|channels|res|resolution))(?:(?:_(?P<num>\d+))|(?:_(?P<lang>[^_0-9\$\n]+)(?:_(?P<num2>\d+))?))?\$"
Local $sString = "$alang$" & @CRLF & _
"$alang_0$" & @CRLF & _
"" & @CRLF & _
"$acodec$" & @CRLF & _
"$acodec_0$" & @CRLF & _
"$acodec_jp$" & @CRLF & _
"$acodec_jp_0$" & @CRLF & _
"" & @CRLF & _
"$aformat$" & @CRLF & _
"$aformat_0$" & @CRLF & _
"$aformat_jp$" & @CRLF & _
"$aformat_jp_0$" & @CRLF & _
"" & @CRLF & _
"$ach$" & @CRLF & _
"$ach_0$" & @CRLF & _
"$ach_jp$" & @CRLF & _
"$ach_jp_0$" & @CRLF & _
"" & @CRLF & _
"$achannels$" & @CRLF & _
"$achannels_0$" & @CRLF & _
"$achannels_jp$" & @CRLF & _
"$achannels_jp_0$" & @CRLF & _
"" & @CRLF & _
"$codec$" & @CRLF & _
"" & @CRLF & _
"$res$ $vformat$ $aformat_jp$ $ach_0$"
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