CodeGuru CodeGuru - 3 months ago 19
Objective-C Question

Extract vimeo video Id from vimeo url objective-c

I want to extract video id from a vimeo url, can any body help me with the RegEx for the same.

Video url can be of type

this is just a sample url. RegEx should work for all vimeo urls.


plz try this code

NSString *yourStr = @"";
NSString *str = [yourStr stringByReplacingOccurrencesOfString: @"https://" withString:@""];

 NSArray *arryVedios =[str componentsSeparatedByString:@"/"] ;

NSString *id= [ arryVedios lastObject];
 NSLog(@"id= %@",id);

this code work for every url.but your id must be in last.