#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?:(?<=^)|(?<=\s))((?:2[0-5][0-5]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\.(?:2[0-5][0-5]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3})(?=\s|$)"
Local $sString = "IP Address:" & @CRLF & _
"93.114.205.169" & @CRLF & _
"0.0.0.0" & @CRLF & _
"0.0.0.0" & @CRLF & _
"10.10.10.10" & @CRLF & _
"99.99.99.99" & @CRLF & _
"199.199.199.199" & @CRLF & _
"255.255.255.255" & @CRLF & _
"256.256.256.256" & @CRLF & _
"02.02.02.02" & @CRLF & _
"111.222.13.255" & @CRLF & _
"1.2.3.4" & @CRLF & _
"1.2.3.4.5" & @CRLF & _
"11.22.33.44" & @CRLF & _
"11.22.33.44.55" & @CRLF & _
"255.0.1.254" & @CRLF & _
"255.0.1.254" & @CRLF & _
"In a text 255.0.1.254 there is an IP address" & @CRLF & _
"In a text 10.10.10.10 there is an IP address" & @CRLF & _
"In a text 93.114.205.169 there is an IP address" & @CRLF & _
"" & @CRLF & _
"Domain:" & @CRLF & _
"example.com" & @CRLF & _
"https://sub5-7.example.com/" & @CRLF & _
"https://sub5-7.example.com" & @CRLF & _
"sub.sub2.example.com" & @CRLF & _
"www.example.com" & @CRLF & _
"https://sub.example.com" & @CRLF & _
"http://example.com" & @CRLF & _
"ftp://sub.mit-example222.com" & @CRLF & _
"In a text www.example.com there is an domain." & @CRLF & _
"In a text https://sub5-7.example.com there is an domain." & @CRLF & _
"In a text www.example.com there is an domain." & @CRLF & _
"" & @CRLF & _
"URL" & @CRLF & _
"93.114.205.169/path" & @CRLF & _
"example.com/path" & @CRLF & _
"sub.example.com/path" & @CRLF & _
"93.114.205.169/path" & @CRLF & _
"https://sub5-7.example.com/" & @CRLF & _
"http://example.com/" & @CRLF & _
"example.com/" & @CRLF & _
"sub.example.com/" & @CRLF & _
"www.--example.com/" & @CRLF & _
"www.examp--le.com/" & @CRLF & _
"www.example.co/" & @CRLF & _
"www.example.c/" & @CRLF & _
"example.com/path" & @CRLF & _
"sub.example.com/path" & @CRLF & _
"sub.example.com/path" & @CRLF & _
"sub.example.com/path" & @CRLF & _
"sub.example.com/path/path/path/p/a/q/1$%h" & @CRLF & _
"sub.example.com/path/path/path/p/a/q/1$%1fh" & @CRLF & _
"sub.example.com/path/path/%aa%1f%3dpath/p/a/q/1$%1fh" & @CRLF & _
"https://sub.example.com/path/path" & @CRLF & _
"http://sub.example.com/path/path" & @CRLF & _
"http://something.com/#$SLJFHsdq32908432098=!~abc" & @CRLF & _
"In a text example.com/path there is an URL path." & @CRLF & _
"In a text www.example.com/path there is an URL path." & @CRLF & _
"In a text www.blog.example.com/path there is an URL path." & @CRLF & _
"In a text sub.example.com/paththere is an URL path." & @CRLF & _
"In a text sub.example.com/path/path/path/p/a/q/1$%h there is an URL path." & @CRLF & _
"In a text sub.example.com/path/path/path/p/a/q/ there is an URL path." & @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