#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)( # start capture url" & @CRLF & _
"(?:(?:(?:ht|f)tps?\:)\/\/?|(?:www\.)) # start with http or www " & @CRLF & _
"(?:\s?[:\w?=%&+-]+ # need some chars in url, allow spaces." & @CRLF & _
"(?:(?:(?:\.)|(?:\/(?:\/)?)))? # can have ., / or // inside urls." & @CRLF & _
")+ # allow repeat alternating pattern of chars and delimiters" & @CRLF & _
") # end capture url"
Local $sString = "http://www.apple.com/legal/ privacy/." & @CRLF & _
"" & @CRLF & _
"abbbbbbbbbbbb" & @CRLF & _
"abababab" & @CRLF & _
"aaab" & @CRLF & _
"hi" & @CRLF & _
"h123213i.what" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"let's do some URLs next segment> " & @CRLF & _
"https://duckduckgo.com/?q=perl+regex+%2Fmxsp&t=canonical&atb=v143-1&ia=web, http://www.rexegg.com/regex-modifiers.html" & @CRLF & _
" <segment hi there segment> https://duckduckgo.com/?q=tutorial+perl+regex+substitution+capture+groups&t=canonical&atb=v143-1&ia=web-https://regex101.com/, www.giggle.com" & @CRLF & _
"" & @CRLF & _
"B. Privacy Policy. At all times your information will be treated in accordance with Appleās Privacy Policy, which is incorporated by reference into this License and " & @CRLF & _
"can be viewed at: http://www.apple.com/legal/ privacy/. qweqweqwewqe" & @CRLF & _
"" & @CRLF & _
"www.howdy.com/welcome::&5"
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