#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?xm)(?(DEFINE)" & @CRLF & _
"(?<WebAddress> (?&Protocol){0,}(?&Host)(?:\:(?&Port)){0,1}(?&Path){0,1})(?=\s|$)" & @CRLF & _
"(?<Protocol> \w{2,}\:\/\/)" & @CRLF & _
"(?<Host> (?&NameParts)(?&Suffix))" & @CRLF & _
"(?<NameParts> (\w{2,}\.){1,})" & @CRLF & _
"(?<Suffix> (\w{2,}))" & @CRLF & _
"(?<Port> (\d{1,5}))" & @CRLF & _
"(?<Path> (\/\S{1,}))" & @CRLF & _
")" & @CRLF & _
"((?&WebAddress))"
Local $sString = "http://asdf.com" & @CRLF & _
"http://www.google.com:80/path?asdf-asdf=adsfddk@ffs" & @CRLF & _
"http://asdf.com" & @CRLF & _
"https://adfdfffdfds.edu" & @CRLF & _
"asd.edu:8383" & @CRLF & _
"jjhgf.net:21" & @CRLF & _
"https://uno.mbsc.asdf.com:1233" & @CRLF & _
"google.com" & @CRLF & _
"mbsc.unomaha.edu" & @CRLF & _
"ftp.unomaha.edu" & @CRLF & _
"asdf.com " & @CRLF & _
"ftp.dd.dfffffdfdfdfdfdfdfdfdfdfdf " & @CRLF & _
"sdf.com" & @CRLF & _
"abc.def.com" & @CRLF & _
"https://msn.sdf.com:123" & @CRLF & _
"http://asd.com" & @CRLF & _
"ftp://ftp.mbsc.unomaha.edu:81813" & @CRLF & _
"http://www.mbsc.unomaha.edu" & @CRLF & _
"https://www.mbsc.unomaha.edu:1231/path?docid=-123" & @CRLF & _
"weather.tv" & @CRLF & _
"www.google.com" & @CRLF & _
"google.com/asdf?coxd" & @CRLF & _
"" & @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