Test, validate and match regular expressions
This regex extracts the video ID from various standard and URL-encoded YouTube URL formats. It uses a positive lookbehind to match sequences following patterns like 'watch?v=', 'youtu.be/', or their percent-encoded equivalents. The actual ID is captured by matching all characters up until a query parameter, fragment, or newline. It is highly useful for scraping, link parsing, or organizing data containing YouTube links.