#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?:(?<mcversion>\d+\.\d+(?:\.\d+){0,1})-){0,1}(?<fullver>(?<version>\d+(?:\.\d+)*)(?:[-+](?<extra>.*))?)"
Local $sString = "Raw Version:" & @CRLF & _
"1.0.0" & @CRLF & _
"1.2.3.4" & @CRLF & _
"1.0" & @CRLF & _
"" & @CRLF & _
"Prefixed with version:" & @CRLF & _
"1.7.10-1.2.3" & @CRLF & _
"1.8.1-10.0.0.1" & @CRLF & _
"1.10.10-2" & @CRLF & _
"1.5-4.63.2" & @CRLF & _
"" & @CRLF & _
"Extra Information" & @CRLF & _
"1.6-4.4.4.4-SNAPSHOT-BULLSHIT" & @CRLF & _
"1.6-SNAPSHOT-BULLSHIT" & @CRLF & _
"" & @CRLF & _
"With Metadata Support" & @CRLF & _
"1.0.0-alpha+001" & @CRLF & _
"1.0.0+20130313144700" & @CRLF & _
"1.0.0-beta+exp.sha.5114f85"
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