#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([A-Za-z0-9\\\/_\-]|([A-Za-z0-9\\\/_\-][A-Za-z0-9\\\/_\- ]{0,18}[A-Za-z0-9\\\/_\-]))$"
Local $sString = "kkdkd df sdf lk aj33" & @CRLF & _
"12345678901234567890" & @CRLF & _
"kjlf l-Ka034-/\_ kj0" & @CRLF & _
"adsfdsafsdaf dsfsdfa" & @CRLF & _
"dlASjd83_-/\dfdsfsda" & @CRLF & _
"adsfsdas sdafsdafsa" & @CRLF & _
"73jkjdfKJH_/\-_saf97" & @CRLF & _
"dsfsdf" & @CRLF & _
"2" & @CRLF & _
"11" & @CRLF & _
"111" & @CRLF & _
"- dsf" & @CRLF & _
"-df" & @CRLF & _
"/dsaf" & @CRLF & _
"\asdf" & @CRLF & _
"_asdf" & @CRLF & _
"_ sdfjlksdaflk jasdf" & @CRLF & _
"adsfsdas sdafsdafs#" & @CRLF & _
" adsfsdafsdfsdfsadds" & @CRLF & _
"dddddddfsdafljkasdd " & @CRLF & _
"$" & @CRLF & _
"123456789012345678901" & @CRLF & _
" asdf" & @CRLF & _
" " & @CRLF & _
"2 " & @CRLF & _
" 2" & @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