http://www.youtube.com/v/[videoid]
http://www.youtube.com/watch?v=[videoid]
http://www.youtube.com/watch?v=[videoid]&feature=blabla
http://www.youtube.com/?v=[videoid]
http://www.youtube.com/?v=[videoid]
Thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
http://www.youtube.com/v/[videoid]
http://www.youtube.com/watch?v=[videoid]
http://www.youtube.com/watch?v=[videoid]&feature=blabla
http://www.youtube.com/?v=[videoid]
http://www.youtube.com/?v=[videoid]
Thanks
Last edited by sledjama; June 25th, 2011 at 10:08 AM.
Or you could use indexOf() and substring()
users will be supplying the youtube url, the video id will vary so i cant search for what i am actually looking for
if i have it, why search i the first place.
i copied this from someone's code (http://gdata-java-client.googlecode....iteClient.java)
something tells me i will be able to apply it but am not sure if it's right.Pattern p = Pattern.compile("http.*\\?v=([a-zA-Z0-9_\\-]+)(?:&.)*");
Matcher m = p.matcher(input);
if (m.matches()) {
input = m.group(1);
}
return input;
Thanks Norm for your input
Your posted example showed bounding []s that could be searched for.
Or the leading v= and the ending &.
See cross post at: http://www.java-forums.org/new-java/...ing-regex.html
Last edited by Norm; June 25th, 2011 at 11:04 AM.