#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<scheme>\w+):\/\/((?<user>\w+)(\:(?<password>[^\/:]+))?@)?(?<hostname>[\w-.]+)(:(?<port>\d+))?\/(?<request>(?<path>[^#\s\?]+)(\?(?<query>[^#\s]+))?(#(?<fragment>[^#\s]+))?)?"
Local $sString = "https://example.org/absolute/URI/with/absolute/path/to/resource.txt" & @CRLF & _
"https://example.org/absolute/URI/with/absolute/path/to/resource.txt?a=alpha&b=bravo#bookmark" & @CRLF & _
"https://username:password@example.org:443/absolute/URI/with/absolute/path/to/resource.txt?a=alpha&b=bravo#bookmark" & @CRLF & _
"ftp://example.org/resource.txt" & @CRLF & _
"ftp://johndoe@example.org/resource.txt" & @CRLF & _
"ftp://janedoe:pa$$word@example.org/resource.txt" & @CRLF & _
"urn:ISSN:1535–3613" & @CRLF & _
"https://example.org/absolute/URI/with/absolute/path/to/resource.txt" & @CRLF & _
"https://username@example.org:443/absolute/URI/with/absolute/path/to/resource.txt?a=alpha&b=bravo#bookmark" & @CRLF & _
"https://username:password@example.org/absolute/URI/with/absolute/path/to/resource.txt?a=alpha&b=bravo#bookmark" & @CRLF & _
"https://username:pa$$w0rd@example.org:443/absolute/URI/with/absolute/path/to/resource.txt?a=alpha&b=bravo" & @CRLF & _
"//example.org/scheme-relative/URI/with/absolute/path/to/resource.txt" & @CRLF & _
"https://username:pa$$w0rd@example.org:443/absolute/URI/with/absolute/path/to/resource.txt#chap01" & @CRLF & _
"relative/path/to/resource.txt" & @CRLF & _
"../../../resource.txt" & @CRLF & _
"./resource.txt#frag01" & @CRLF & _
"resource.txt" & @CRLF & _
"#frag01" & @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