#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(https?:\/\/)?(www.)?(facebook\.com)\/(\S*\/)*(videos?\/(embed\?video_id=|vb.\d+\/)?)(\d+)"
Local $sString = "https://www.facebook.com/video/embed?video_id=368508506585276" & @CRLF & _
"https://www.facebook.com/1399785403664362/videos/1428693740773528/" & @CRLF & _
"https://www.facebook.com/snackk100/videos/754790044667598/?permPage=1" & @CRLF & _
"https://www.facebook.com/insight.co.kr/videos/vb.374726359324617/907652546031993/?type=2&theater" & @CRLF & _
"https://www.facebook.com/Jrockradio/videos/vb.102198813200663/880536688700201/?type=2&theater"
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