#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)https?:\/\/(?:open\.)?spotify.com\/(user|episode|playlist|track)\/(?:spotify\/playlist\/)?(\w*)"
Local $sString = "https://open.spotify.com/user/spotify/playlist/37i9dQZF1DZ06evO2ZpGiQ?si=-6S0EBlURrao__YyIOW6bg" & @CRLF & _
"" & @CRLF & _
"https://open.spotify.com/episode/0aib8d7Hi7N9Td6eVKliWC?si=8f846b406a844873" & @CRLF & _
"https://open.spotify.com/playlist/7Kk0KvfzcaX4QLtli1rIBK" & @CRLF & _
"https://open.spotify.com/track/6PEd4IINRYCvjDXfKxO0pE?si=8f3fae6b22d64006" & @CRLF & _
"https://open.spotify.com/playlist/7Kk0KvfzcaX4QLtli1rIBK?si=dde5fbdbe97c4cfc" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"https://spotify.com/user/spotify/playlist/37i9dQZF1DZ06evO2ZpGiQ?si=-6S0EBlURrao__YyIOW6bg" & @CRLF & _
"" & @CRLF & _
"https://spotify.com/episode/0aib8d7Hi7N9Td6eVKliWC?si=8f846b406a844873" & @CRLF & _
"https://spotify.com/playlist/7Kk0KvfzcaX4QLtli1rIBK " & @CRLF & _
"https://spotify.com/track/6PEd4IINRYCvjDXfKxO0pE?si=8f3fae6b22d64006" & @CRLF & _
"https://spotify.com/playlist/7Kk0KvfzcaX4QLtli1rIBK?si=dde5fbdbe97c4cfc" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"spotify:user:spotify:playlist:37i9dQZF1DZ06evO2ZpGiQ"
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