#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<Semantic>(?<Major>[0-9]+)\.(?<Minor>[0-9]+)(?:\.(?=[0-9]))?(?<Maintenance>[0-9]+)?(?:\.(?=[0-9]))?(?<Patch>[0-9]+)?)(?<Label>(?:(?:\.|\-|\+)?\w+)+)?"
Local $sString = "Should Match:" & @CRLF & _
"5.6.20.4-dev+a2c4ok ok" & @CRLF & _
"1.3.2" & @CRLF & _
"12.0.2.1000 ok" & @CRLF & _
"3.60.2.300 ok" & @CRLF & _
"0.0.2.1-dev ok" & @CRLF & _
"2.0.3.1dev ok" & @CRLF & _
"this is v1.2.3.1 ok" & @CRLF & _
"1.2.3" & @CRLF & _
"30.0000.1.222.3333" & @CRLF & _
"Should Not Match" & @CRLF & _
"1" & @CRLF & _
"1." & @CRLF & _
"12" & @CRLF & _
"12." & @CRLF & _
"123" & @CRLF & _
"123."
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