#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)(youtu(?:\.be|be\.com)\/(?:.*v(?:\/|=)|(?:.*\/)?)([\w'-]+))"
Local $sString = "http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo" & @CRLF & _
"http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel" & @CRLF & _
"http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub" & @CRLF & _
"http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I" & @CRLF & _
"http://www.youtube.com/user/SilkRoadTheatre#p/a/u/2/6dwqZw0j_jY" & @CRLF & _
"http://youtu.be/6dwqZw0j_jY" & @CRLF & _
"http://www.youtube.com/watch?v=6dwqZw0j_jY&feature=youtu.be" & @CRLF & _
"http://youtu.be/afa-5HQHiAs" & @CRLF & _
"http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo?rel=0" & @CRLF & _
"http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel" & @CRLF & _
"http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub" & @CRLF & _
"http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I" & @CRLF & _
"http://www.youtube.com/embed/nas1rJpm7wY?rel=0" & @CRLF & _
"http://www.youtube.com/watch?v=peFZbP64dsU"
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