#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)\bhttps?[-\w.\~:/?#[\]@!$&'()*+,;=]+|[@#](\w+)|U\+([A-F\d]{5})"
Local $sString = "This is a @ping and a #hash." & @CRLF & _
"This is a www.example.com, this is http://example.com?asdf=1234#anchor" & @CRLF & _
"https://www.example.net/a/b/c/?g=5&awesome=foobar# U+23232 http://www5.example.com" & @CRLF & _
"https://sub.sub.www.example.org/ @pong@pug#tagged" & @CRLF & _
"http://example.com/@dave" & @CRLF & _
"more http://example.com/more_(than)_one_(parens)" & @CRLF & _
"andU+98765more http://example.com/blah_(wikipedia)#cite-1" & @CRLF & _
"and more http://example.com/blah_(wikipedia)_blah#cite-1" & @CRLF & _
"and more http://example.com/(something)?after=parens"
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