#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(\d+\.([1-9]{3}|[1-9]{2}|[1-9]|0{1}))(\d*)"
Local $sString = "#提取有效小数的思路:匹配出符合要求的组合不符合要求的组。" & @CRLF & _
"#使用sub函数,re.sub(pat,lambda m:m[1],s)" & @CRLF & _
"#repl使用函数,传递的参数是pat,所匹配的match对象,提取match对象中符合要求的组即可。" & @CRLF & _
"124.1230000012" & @CRLF & _
"124.1200003412" & @CRLF & _
"123.0000000012" & @CRLF & _
"1.2000" & @CRLF & _
""
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