Test, validate and match regular expressions
Matches YouTube video URLs in both watch-page format (youtube.com/watch?v=) and alternate format (youtube.com/v/), capturing the video ID consisting of letters, digits, and underscores. The protocol (http/https) and the www subdomain are both optional, and the match is anchored to the start of the string. Useful for extracting or validating YouTube video IDs from links during data parsing, scraping, or form validation tasks.