#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?=\D*(?:\d\D*){1,12}$)\d+(?:\.\d{1,4})?$"
Local $sString = "Max length of the number is 12 character" & @CRLF & _
"If there is a decimal point in number then the user can add a maximum of 4 digits after the decimal point and minimum 1 digit." & @CRLF & _
"" & @CRLF & _
"Valid Inputs:" & @CRLF & _
"222244445555" & @CRLF & _
"22223333.3333" & @CRLF & _
"5555.33" & @CRLF & _
"1.2" & @CRLF & _
"0.33" & @CRLF & _
"11112222333.3" & @CRLF & _
"" & @CRLF & _
"InValid Inputs: " & @CRLF & _
"22." & @CRLF & _
".11" & @CRLF & _
"2222333344443" & @CRLF & _
"444445555544." & @CRLF & _
"333344445.1234"
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