#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\.0*$|(\.\d*[1-9])0+$"
Local $sString = "0" & @CRLF & _
"00" & @CRLF & _
"01" & @CRLF & _
"1.0" & @CRLF & _
"1.00" & @CRLF & _
"1.001100" & @CRLF & _
"1.101110000" & @CRLF & _
"" & @CRLF & _
"1234870.98762341" & @CRLF & _
"1230009100" & @CRLF & _
"0.0012234" & @CRLF & _
"0.1200234" & @CRLF & _
"0.000001231" & @CRLF & _
"0.10001" & @CRLF & _
"NaN"
Local $sSubst = "$1"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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