#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(?:https?:\/\/)((?:www\.)|(?:m\.))?soundcloud\.com\/[a-z0-9](?!.*?(-|_){2})[\w-]{1,23}[a-z0-9](?:\/.+)?$"
Local $sString = "Use only numbers, lowercase letters, underscores, or hyphens." & @CRLF & _
"Profile URLs must not start or end with an underscore or hyphen." & @CRLF & _
"Profile URLs must not have two consecutive underscores or hyphens." & @CRLF & _
"Profile URLs must be between 3 and 25 characters." & @CRLF & _
"" & @CRLF & _
"http://www.soundcloud.com/fo" & @CRLF & _
"http://www.soundcloud.com/foo" & @CRLF & _
"https://m.soundcloud.com/abcd123" & @CRLF & _
"https://soundcloud.com/abcd123" & @CRLF & _
"https://soundcloud.com/" & @CRLF & _
"https://m.soundcloud.com/abcd123_l" & @CRLF & _
"https://soundcloud.com/abcd123-l" & @CRLF & _
"http://www.soundcloud.com/-abcd123" & @CRLF & _
"http://www.soundcloud.com/_abcd123" & @CRLF & _
"https://m.soundcloud.com/abcd123-_l" & @CRLF & _
"https://m.soundcloud.com/abcd123--l" & @CRLF & _
"https://m.soundcloud.com/1234567890123456789012345" & @CRLF & _
"https://m.soundcloud.com/12345678901234567890123456" & @CRLF & _
"https://m.soundcloud.com/1234567890123456789012345/fooo12;lkflkjlfjkljskljflks/" & @CRLF & _
"https://m.soundcloud.com/12345678901234567890123456/fooo" & @CRLF & _
"http://www.m.soundcloud.com/abcdef"
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