#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)"
Local $sString = "Welcome to RegExr 0.3b, an intuitive tool for learning, writing, and testing Regular Expressions. Key features include: " & @CRLF & _
"" & @CRLF & _
"* real time results: shows results as you type " & @CRLF & _
"* code hinting: roll over your expression to see info on specific elements " & @CRLF & _
"* detailed results: roll over a match to see details & view group info below " & @CRLF & _
"* built in regex guide: double click entries to insert them into your expression " & @CRLF & _
"* online & desktop: regexr.com or download the desktop version for Mac, Windows, or Linux " & @CRLF & _
"* save your expressions: My Saved expressions are saved locally " & @CRLF & _
"* search Community expressions and add your own " & @CRLF & _
"* create Share Links to send your expressions to co-workers or link to them on Twitter or your blog [ex. http://RegExr.com?2rjl6] " & @CRLF & _
"" & @CRLF & _
"Built by gskinner.com with Flex 3 [adobe.com/go/flex] and Spelling Plus Library for text highlighting [gskinner.com/products/spl]." & @CRLF & _
"" & @CRLF & _
"https://google.com" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"https:google.com" & @CRLF & _
"" & @CRLF & _
"www.cool.com.au" & @CRLF & _
"" & @CRLF & _
"http://www.cool.com.au" & @CRLF & _
"" & @CRLF & _
"http://www.cool.com.au/ersdfs" & @CRLF & _
"" & @CRLF & _
"http://www.cool.com.au/ersdfs?dfd=dfgd@s=1" & @CRLF & _
"" & @CRLF & _
"http://www.cool.com:81/index.html"
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