If you want to learn how to use regular expressions in Elixir, take a look at the documentation of the Regex module which has a nice introduction to using them and detailed information about the individual methods: https://hexdocs.pm/elixir/Regex.html
But probably the best version is to properly parse the URL and extract the video ID from the parsed URL. Pattern matching as shown by me will not work correctly when there are other parameters in the query string, and regular expressions that cover those possibilities tend to grow into an unreadable and slow monstrosity.
You really do not wan’t to do this using regular expressions, it will break earlier or later. Please use a proper URI-parser and extract all necessary information from there.
But to extract the ID from the first link, you can use ~r"https?://youtu.be/(?<id>.*)". I do still leave it as an exercise to append it to any string you like.
As we already said earlier, regular expressions will either be error prone or utterly complex for this task. If you really want to use regular expressions, then build them for yourself from the ground up. I already gave you an example of how to do it. All the other URLs fit in the same pattern, if the quick and dirty solution is good enough for you.
There will be so many valid youtube links, you won’t cover with simple regular expressions… Any valid youtube.com URL will possible be valid with any other TLD as well.
The probably most accurate way, to really be sure that a given URL is not only generically valid, but also is a video and to get its embed link, is to fetch the URL and read the HTMLs meta-information.
Currently every valid video page will have a meta-field with the name twitter:player and the embed link as content.
edit
Sorry, I got your question wrong. I understood that you wanted to get regular expressions for the other examples you gave, but actually you wan’t to see an example of how to use the regular expression I gave you.
So here a very generic example of how to extract something from a string using an regular expression and named matches: