#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(http|https)?:\/\/(www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|)(\d+)(?:|\/\?)"
Local $sString = "Vimeo Regex" & @CRLF & _
"" & @CRLF & _
"# plain ok" & @CRLF & _
"https://vimeo.com/62092214" & @CRLF & _
"http://vimeo.com/62092214" & @CRLF & _
"https://www.vimeo.com/62092214" & @CRLF & _
"" & @CRLF & _
"# plain not ok" & @CRLF & _
"http://vimeo/62092214" & @CRLF & _
"http://vimeo.com/foo" & @CRLF & _
"" & @CRLF & _
"# channels ok:" & @CRLF & _
"https://vimeo.com/channels/documentaryfilm/128373915" & @CRLF & _
"" & @CRLF & _
"# channels not ok:" & @CRLF & _
"https://vimeo.com/channels/foo-barr/documentaryfilm/128373915" & @CRLF & _
"" & @CRLF & _
"# groups ok:" & @CRLF & _
"https://vimeo.com/groups/musicvideo/videos/126199390" & @CRLF & _
"" & @CRLF & _
"# groups not ok:" & @CRLF & _
"http://vimeo.com/groups/musicvideo/vid/126199390" & @CRLF & _
"" & @CRLF & _
"# attributes ok:" & @CRLF & _
"https://vimeo.com/62092214?query=foo" & @CRLF & _
"" & @CRLF & _
"# attributes not ok:" & @CRLF & _
"https://vimeo.com.omomom/62092214?query=foo"
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