CodeGuru CodeGuru - 7 months ago 57
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.