#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([a-zA-Z]{0,3}\$\s*)?(([1-9]\d{0,2})(,\d{3}){0,3}(,\d{3})|(\d{1,14}))(\.\d{2})?$"
Local $sString = "/* Valid */" & @CRLF & _
"$9" & @CRLF & _
"R$9.99" & @CRLF & _
"R$ 9.99" & @CRLF & _
"BRL$9.99" & @CRLF & _
"9" & @CRLF & _
"99999999999999" & @CRLF & _
"99999999999999.99" & @CRLF & _
"9,000.99" & @CRLF & _
"99,000.99" & @CRLF & _
"999,000.99" & @CRLF & _
"9,000,000.99" & @CRLF & _
"99,000,000.99" & @CRLF & _
"999,000,000.99" & @CRLF & _
"999,000,000.99" & @CRLF & _
"9,000,000,000.99" & @CRLF & _
"99,000,000,000.99" & @CRLF & _
"999,000,000,000.99" & @CRLF & _
"9,000" & @CRLF & _
"99,000" & @CRLF & _
"999,000" & @CRLF & _
"9,000,000" & @CRLF & _
"99,000,000" & @CRLF & _
"999,000,000" & @CRLF & _
"999,000,000" & @CRLF & _
"9,000,000,000" & @CRLF & _
"99,000,000,000" & @CRLF & _
"999,000,000,000" & @CRLF & _
"/* Invalid */" & @CRLF & _
"R9" & @CRLF & _
"R$9,99" & @CRLF & _
"999999999999999" & @CRLF & _
"999999999999999.99" & @CRLF & _
"0,000.99" & @CRLF & _
"09,000.99" & @CRLF & _
"099,000.99" & @CRLF & _
"0,000,000.99" & @CRLF & _
"09,000,000.99" & @CRLF & _
"099,000,000.99" & @CRLF & _
"099,000,000.99" & @CRLF & _
"0,000,000,000.99" & @CRLF & _
"09,000,000,000.99" & @CRLF & _
"099,000,000,000.99" & @CRLF & _
"0,999" & @CRLF & _
",99,000" & @CRLF & _
"99,9,000" & @CRLF & _
"99,99,000" & @CRLF & _
"9,9999,000" & @CRLF & _
"9,99,000,000" & @CRLF & _
",999999,000" & @CRLF & _
"99,99,000,000" & @CRLF & _
"999,999999,000" & @CRLF & _
"999999,000,000"
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