#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(www.|https?:\/\/(?:www.)?)?([a-z-_0-9]*)(?:\.)"
Local $sString = "www.xakep.ru" & @CRLF & _
"https://swapi.co/api/planets/12/ //swapi" & @CRLF & _
"http://github.com/carbonfive/raygun //github" & @CRLF & _
"http://www.zombie-bites.com //" & @CRLF & _
"https://www.cnet.com" & @CRLF & _
"http://google.co.jp" & @CRLF & _
"http://github.com/carbonfive/raygun" & @CRLF & _
"https://www.cnet.com" & @CRLF & _
"xewveqmwcz90sl64.co/" & @CRLF & _
"zx06u3ep-tcp8b25l.info" & @CRLF & _
"j4yfack7z7pui8b8j-d3-abfdvp.it/img/" & @CRLF & _
"z8rabv26m.com"
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