#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?imu)^(?:https?:\/\/)?(?:(?:[\pL0-9-]+)\.)+[\pL]{2,}(?:\/.*)?$"
Local $sString = "http://google.com" & @CRLF & _
"https://google.com" & @CRLF & _
"http://google.com/" & @CRLF & _
"https://google.com/" & @CRLF & _
"http://g oogle.com" & @CRLF & _
"http://google.com/somepath" & @CRLF & _
"https://g oogle.com/somepath" & @CRLF & _
"https://g_oogle.com/somepath" & @CRLF & _
"google.com" & @CRLF & _
"google.com/somepath" & @CRLF & _
"goo gle.com/badpath" & @CRLF & _
"кириллица.укр" & @CRLF & _
"кирилл ица.укр" & @CRLF & _
"кириллица.укр/путь" & @CRLF & _
"кирилл01ица.укр" & @CRLF & _
"кирилли-ца.укр/путь" & @CRLF & _
"собдомен.кириллица.укр" & @CRLF & _
"собдомен.кириллица.укр/путь" & @CRLF & _
"2саб.1саб.домен.укр" & @CRLF & _
"2саб.1с-аб.до мен.укр"
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