Test, validate and match regular expressions
Extracts 11-character YouTube video IDs from URLs across common formats, including youtu.be/, youtube.com (watch, embed, shorts), and youtube-nocookie.com, with optional protocol, subdomain, and trailing query strings. Lookaheads ensure the ID ends cleanly and skip IDs already embedded inside HTML anchor tags (e.g., <a href="..."> or </a>). Useful for finding, validating, or converting YouTube links in text, such as turning them into embed URLs.