如何从URL IOS 9获取DailyMotion视频ID

时间:2016-03-08 06:26:18

标签: ios objective-c iphone xcode dailymotion-api

http://www.dailymotion.com/video/x3vfu7n_kashif-abbasi-take-class-of-zaeem-qadri_news 我需要从dailymotion网址获取视频ID。我需要正则表达式。感谢

1 个答案:

答案 0 :(得分:1)

尝试以下正则表达式:

    NSString *strRegExp=@"/video/([^_]+)/";

    NSError *regexError = nil;
    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:strRegExp options:NSRegularExpressionCaseInsensitive error:&regexError];

    if (regexError) {
        NSLog(@"regexError: %@", regexError);

    }