How to use dart regex to extract YouTube video ID from video URL?
Example URL
https://www.youtube.com/watch?v=SEkUienM2oY&t=1265s
or
https://m.youtube.com/watch?v=SEkUienM2oY&t=1265s
Return
SEkUienM2oY&t=1265s
Its working for me
String getVideoID(String url) {
url = url.replaceAll("https://www.youtube.com/watch?v=", "");
url = url.replaceAll("https://m.youtube.com/watch?v=", "");
return url;
}
but how to do this with Regex??