#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\d+\.\d+(\.[\d]+)?"
Local $sString = "/Versionnr: 5.131 //should be 5.13" & @CRLF & _
"/Versionname: somename v5.13b1" & @CRLF & _
"/Versionnr: 2.0..4 //should be 2.0" & @CRLF & _
"/Versionname: another name 2 v2.0.exp.4" & @CRLF & _
"/Versionnr: 18.01 //should be 18.0" & @CRLF & _
"/Versionname: somename v18.0-ALPHA1" & @CRLF & _
"/Versionnr: 7.2.42221..3634639 //should be 7.2.4222" & @CRLF & _
"/Versionname: another name v7.2.4222-1.L.3634639" & @CRLF & _
"/Versionnr: 5.0.220170112 //should be 5.0.2" & @CRLF & _
"/Versionname: somename v5.0.2 build 20170112" & @CRLF & _
"/Versionnr: 4.4.0.201701124401 //should be 4.4.0" & @CRLF & _
"/Versionname: another name v4.4.0.20170112b4401"
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