#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((?<=[^a-zA-Z0-9])(?:https?\:\/\/|[a-zA-Z0-9]{1,}\.{1}|\b)(?:\w{1,}\.{1}){1,5}(?:com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil|iq|io|ac|ly|sm){1}(?:\/[a-zA-Z0-9]{1,})*)"
Local $sString = "== Good ==" & @CRLF & _
"" & @CRLF & _
"https://facebook.com/marko/polo" & @CRLF & _
"https://facebook.com/marko/pol2o" & @CRLF & _
"www.moshe.io" & @CRLF & _
"http://marko.polo.com" & @CRLF & _
"subdomain.pizza.com" & @CRLF & _
"bitly.com/14awOx4" & @CRLF & _
"" & @CRLF & _
"== Good in random text" & @CRLF & _
"Dude, I'm telling you, every other https://facebook.com/marko/polo URL regex just so sucked. it even crashed https://facebook.com/marko/pol2o. In one case + there are case where www.moshe.io would be cought but this one works likes charm http://marko.polo.com exactly what I needed // // look it doesn't catch subdomain.pizza.com anyhthing else ! it's totally amazing !" & @CRLF & _
"bitly.com/fdsafdf" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"== Bad ==" & @CRLF & _
"" & @CRLF & _
"https://www.........more..........no/com" & @CRLF & _
"4.5x10.9" & @CRLF & _
"etc..!" & @CRLF & _
"me.you" & @CRLF & _
"you.them" & @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