YouTube Video ID Grabber - Works for both video and shorts
This page is designed to extract the video ID from a YouTube video URL. I have used a simple JavaScript regular expression to match the pattern and extract the video ID from the string. The JavaScript regular expression code is provided below, /[?=/]([A-Za-z0-9_-]{10}[AEIMQUYcgkosw048])[?=/]*?/g Live demonstration: YouTube Video ID Grabber Enter the YouTube URL Regular Expression Explanation [ Character set. Match any character in the set. ? Character. Matches a "?" character (char code 63). = Character. Matches a "=" character (char code 61). / Character. Matches a "/" character (char code 47). ] ( Capturing group #1. Groups multiple tokens together and creates a capture grou...