#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)"
Local $sString = "https://play.google.com/store/apps/details?id=com.skgames.trafficracer%22" & @CRLF & _
"http://mplay.google.co.in/sadfask/asdkfals?dk=10" & @CRLF & _
"http://lplay.google.co.in/sadfask/asdkfals?dk=10" & @CRLF & _
"http://play.google.co.in/sadfask/asdkfals?dk=10" & @CRLF & _
"http://tplay.google.co.in/sadfask/asdkfals?dk=10?" & @CRLF & _
"http://www.google.co.in:/sadfask/asdkfals?dk=10" & @CRLF & _
"www.google.co.in/sadfask/asdkfals?dk=10" & @CRLF & _
"https://user:pass@google.com/?a=b#asdd" & @CRLF & _
"//mplay.google.co.in" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"-- Regular expression ^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)" & @CRLF & _
"-- used below extracts domain with subdomains out of a full url." & @CRLF & _
"-- It skips protocol (ex: https:), "//", "@", www subdomain and" & @CRLF & _
"-- then captures everything (ex: domain) before ":" or "/" or end of line."
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