Test, validate and match regular expressions
Matches YouTube URLs covering both youtube.com and the shortened youtu.be domain, with optional http/https protocol and optional m. or www. subdomain. Optionally matches the URL path containing letters, digits, slashes, and query string characters like ? and =. With the gmi flags, it finds all YouTube links case-insensitively across multiple lines. Useful for extracting, detecting, or validating YouTube video links from text, comments, or user input.