#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\$?[0-9]{1,3}(?:,[0-9]{3})*(?:\.[0-9]+)?$"
Local $sString = "Here are some test cases that it needs to match" & @CRLF & _
"" & @CRLF & _
"76,249.25" & @CRLF & _
"131,588.00" & @CRLF & _
"7.09" & @CRLF & _
"21.27" & @CRLF & _
"420.42" & @CRLF & _
"54.77" & @CRLF & _
"32.848" & @CRLF & _
"3,056.12" & @CRLF & _
"0.009" & @CRLF & _
"0.01" & @CRLF & _
"32.85" & @CRLF & _
"2,948.59" & @CRLF & _
"$99,249.25" & @CRLF & _
"$9.0000" & @CRLF & _
"$1,800.0000" & @CRLF & _
"$1,000,000" & @CRLF & _
"Here are some test cases that it should not target" & @CRLF & _
"" & @CRLF & _
"666-257-6443" & @CRLF & _
"F1A 5G9" & @CRLF & _
"Bolt, Locating, M8 x 1.25 x 30 L" & @CRLF & _
"Precision Washer, 304 SS, 0.63 OD x 0.31" & @CRLF & _
"Flat Washer 300 Series SS; Pack of 50" & @CRLF & _
"U-SSFAN 0.63-L6.00-F0.75-B0.64-T0.38-SC5.62" & @CRLF & _
"U-CLBUM 0.63-D0.88-L0.875" & @CRLF & _
"U-WSSS 0.38-D0.88-T0.125" & @CRLF & _
"U-BGHK 6002ZZ - H1.50" & @CRLF & _
"U-SSCS 0.38-B0.38" & @CRLF & _
"6412K42" & @CRLF & _
"Std Dowel, 3/8" x 1-1/2" Lg, Steel" & @CRLF & _
"2019.07.05" & @CRLF & _
"2092-002.0180" & @CRLF & _
"SHCMG 0.25-L1.00" & @CRLF & _
"280160717"
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