Extract with Regex empty

This one seems to work, and I like its brevity…

(?<=v=|v\/|embed\/|be\/)([^&?]+)

Here’s a list of all the URL variants with which it was tested. I can’t take credit, however. I got it from the library of my preferred regex tester.

Let us know if it works out for you.

6 Likes