#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mu)^\d{1,5}[-\p{L}][-\p{L}\d]{0,9}$"
Local $sString = "12345a235" & @CRLF & _
"123a" & @CRLF & _
"12345-aa1" & @CRLF & _
"12345a" & @CRLF & _
"12345-a" & @CRLF & _
"" & @CRLF & _
"12-a235dkfsf" & @CRLF & _
"12-a235dkfsfs" & @CRLF & _
"" & @CRLF & _
"123a-dssava-y" & @CRLF & _
"123a-dssava-1a" & @CRLF & _
"" & @CRLF & _
"12345-aa1--asd-" & @CRLF & _
"12345-aa1--asd-s" & @CRLF & _
"" & @CRLF & _
"-11" & @CRLF & _
"111111" & @CRLF & _
"aaaa" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"version 1 :: plain ... ^\d{1,5}[-\p{L}][-\p{L}\d]{0,9}$" & @CRLF & _
"version 2 :: named ... ^(?<digitsOnly>\p{N}{1,5})(?<miscellaneous>[-\p{L}][-\p{L}\p{N}]{0,9})$" & @CRLF & _
""
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