#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\b(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]))\b"
Local $sString = "This REGULAR EXPRESSION is just for searching for dotted decimal IPv4 Adresses." & @CRLF & _
"Unlike a shorter one, this one is made for seeing the numbers in seperate Mach-groups-thingy." & @CRLF & _
"I also included some unit tests.. But i think they are not needed." & @CRLF & _
"" & @CRLF & _
"Below are some tests:" & @CRLF & _
"" & @CRLF & _
"Valid:" & @CRLF & _
"0.0.0.0" & @CRLF & _
"1.2.3.4" & @CRLF & _
"127.0.0.1" & @CRLF & _
"8.8.4.4" & @CRLF & _
"8.8.8.8" & @CRLF & _
"255.255.255.255" & @CRLF & _
"249.0.0.1" & @CRLF & _
"0.1.255.254" & @CRLF & _
"98.139.180.149" & @CRLF & _
"69.89.31.226" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Invalid:" & @CRLF & _
"999.999.999" & @CRLF & _
"290.250.2.6" & @CRLF & _
"256.259.20.255" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Texts:" & @CRLF & _
"Google DNS Server IP is 8.8.8.8. As a alternative you can use 8.8.4.4. " & @CRLF & _
"The IP 127.0.0.1 (also known as localhost) is a 'loopback' IP-Adress, pointing to your computer." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Example pinging:" & @CRLF & _
" Microsoft Windows [Version 6.1.7601]" & @CRLF & _
" Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten." & @CRLF & _
" " & @CRLF & _
" C:\Users\Example>ping google.com" & @CRLF & _
" " & @CRLF & _
" Pinging google.com [212.6.83.44] with 32 bytes of data:" & @CRLF & _
" Reply from 212.6.83.44: bytes=32 time=42ms TTL=59" & @CRLF & _
" Reply from 212.6.83.44: bytes=32 time=55ms TTL=59" & @CRLF & _
" Reply from 212.6.83.44: bytes=32 time=35ms TTL=59" & @CRLF & _
" Reply from 212.6.83.44: bytes=32 time=27ms TTL=59" & @CRLF & _
" " & @CRLF & _
" Ping statistics for 212.6.83.44:" & @CRLF & _
" Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)," & @CRLF & _
" Approximate round trip times in milli-seconds:" & @CRLF & _
" Minimum = 27ms, Maximum = 55ms, Average = 39ms" & @CRLF & _
" " & @CRLF & _
" C:\Users\Example>"
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