Test, validate and match regular expressions
Matches YouTube URLs at the start of a line and captures the video ID. Supports youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/ formats, with optional http/https protocol and subdomain (e.g., www.). The final capture group grabs the video identifier, though IDs containing hyphens will only be partially matched due to the \w+ constraint. Useful for extracting video IDs from text or validating YouTube links.