How to get the VideoID of a youtube video using Regex
To get the VideoID of a youtube video using Regex you can use the following snippet. Sample Regex ^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.[a-zA-Z]{1,3}\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\”‘>]+) This will match the Vl1tVxfFf1A in https://www.youtube.com/watch?v=Vl1tVxfFf1A. A more complex regex…