Test, validate and match regular expressions
Extracts the 11-character YouTube video ID from virtually any YouTube URL format, including standard watch links (youtube.com/watch?v=), short links (youtu.be), embed paths (/embed/), and mobile (m.), music, or youtube-nocookie domains. Protocol, subdomain, and domain parts are all optional, so it also matches bare video IDs and handles trailing parameters. The ID is captured in the named group 'videoId' for easy programmatic access. Ideal for URL parsing, link validation, and video embedding workflows.