#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(https?|ftp|file):\/\/|www\.|ftp\.|([\w\-_]+(?:(?:\.|\s*\[dot\]\s*[A-Z\-_]+)+))([A-Z\-\.,@?^=%&:\/~\+#]*[A-Z\-\@?^=%&\/~\+#]){2,6}?"
Local $sString = "Click w3.test.com/test" & @CRLF & _
"test 1.6 test" & @CRLF & _
"test 1.6test" & @CRLF & _
"Click www.testpage.com" & @CRLF & _
"Click2 no desktop.test.com" & @CRLF & _
"test https://stackoverflow.com/questions/60619430/cant-get-newest-data-from-dao-unless-restart-the-app" & @CRLF & _
"word word https://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string test"
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