#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(\-?\d+\.?\d*|\-?\.\d+|\-?\.?\d+[eE]\-?\d+|-?\d+\.?\d*[eE]\d+)($|[a-z]*$)"
Local $sString = "00" & @CRLF & _
"0" & @CRLF & _
"-0" & @CRLF & _
"0." & @CRLF & _
".0ns" & @CRLF & _
"12.3ps" & @CRLF & _
"12.34minute" & @CRLF & _
"-12.34" & @CRLF & _
"10E40sd" & @CRLF & _
"10e40sd" & @CRLF & _
"1E4" & @CRLF & _
"1E-4hours" & @CRLF & _
"-10E40nanosecond" & @CRLF & _
"-10E-40" & @CRLF & _
"-.1E-4" & @CRLF & _
"10.2E30" & @CRLF & _
"10.2e30" & @CRLF & _
".10E30" & @CRLF & _
"-10.2E30" & @CRLF & _
"-.10E30" & @CRLF & _
"" & @CRLF & _
"# wrong numbers" & @CRLF & _
"12.34 # with comment" & @CRLF & _
"12.34.12fdsfdsfds" & @CRLF & _
"1E4.4" & @CRLF & _
".10E30E" & @CRLF & _
"10.2.E30" & @CRLF & _
"123#with wrong comment" & @CRLF & _
"E10" & @CRLF & _
".E10" & @CRLF & _
"-e" & @CRLF & _
"-E10" & @CRLF & _
"10-10E19"
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