#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mi)Stable tag\: (\d+(?:\.\d+)*)$"
Local $sString = "Stable tag: 4.1.5.3" & @CRLF & _
"Stable tag: 11.0.5.3" & @CRLF & _
"Stable tag: 23.1.5.3" & @CRLF & _
"Stable tag: 13.0.1" & @CRLF & _
"Stable tag: 13.0" & @CRLF & _
"Stable tag: 2.0.1" & @CRLF & _
"Stable tag: 3.0.21.4.2" & @CRLF & _
"Stable tag: 3.0" & @CRLF & _
"Stable tag: 3.0.111.32" & @CRLF & _
"Stable tag: 1.0.1.3" & @CRLF & _
"Stable tag: 3" & @CRLF & _
"" & @CRLF & _
""
Local $sSubst = "3.0.13"
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