#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(htt|www\.)(?!.*\1).*$"
Local $sString = "http://www.sample.com" & @CRLF & _
"https://www.sample.com" & @CRLF & _
"http://www.sample.com/xyz" & @CRLF & _
"www.sample.com" & @CRLF & _
"www.sample.com/xyz/#/xyz" & @CRLF & _
"sample.com" & @CRLF & _
"www.sample.com" & @CRLF & _
"mofiz.com" & @CRLF & _
"kolim.com" & @CRLF & _
"www.murikhao.www.sample.com" & @CRLF & _
"http://murihao.www.sample.com" & @CRLF & _
"http://www.sample.com/xyz?abc=dkd&p=q&c=2" & @CRLF & _
"www.sample.gov.bd" & @CRLF & _
"www.sample.com.en" & @CRLF & _
"www.sample.vu" & @CRLF & _
"https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1t5OJ?ver=c8b4" & @CRLF & _
"https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1t5OJ?ver=c8b4https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1t5OJ?ver=c8b4" & @CRLF & _
"www.msft.com" & @CRLF & _
"http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1XqlR?ver=b1bchttp://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RW6fET?ver=80af" & @CRLF & _
"http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1XDkS?ver=6779https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1Etgg" & @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