Test, validate and match regular expressions
Matches complete lines containing YouTube video URLs in two formats: shortened links (https://youtu.be/) and full watch URLs (http://www.youtube.com/watch?v=), followed by any remaining characters such as video IDs and extra query parameters. With the gm flags, it processes text line by line, making it useful for extracting or validating YouTube links from logs or documents. Note it only accepts https for short links and http for the full domain, so variants like https://www.youtube.com or m.youtube.com won't match.