#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(https?:\/\/)?([\w\Q$-_+!*'(),%\E]+\.)+(\w{2,63})(:\d{1,4})?([\w\Q/$-_+!*'(),%\E]+\.?[\w])*\/?$"
Local $sString = "http://google.com" & @CRLF & _
"https://google.com" & @CRLF & _
"http://www.google.com" & @CRLF & _
"" & @CRLF & _
"www.google.com" & @CRLF & _
"www.google.de:8080" & @CRLF & _
"www.test123.de" & @CRLF & _
"www.domain.com.de.whatever.to" & @CRLF & _
"" & @CRLF & _
"www.google" & @CRLF & _
"h4xx0!2.net" & @CRLF & _
"page.to" & @CRLF & _
"" & @CRLF & _
"hallo.to/test/whatever" & @CRLF & _
"hallo.to/test/whatever.cgi" & @CRLF & _
"www.google.com/startpage.html/" & @CRLF & _
"" & @CRLF & _
"www.google.!!!" & @CRLF & _
"www..com" & @CRLF & _
"http://blabla.computer.de/......................."
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