CodeGuru CodeGuru - 1 year ago 133
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download