Search code examples
objective-ciosregexvimeo

Get Vimeo clip_id from url with regex in objective C


Can anybody tell me how to extract the clip_id from a Vimeo url using Obj C regex?

http://vimeo.com/moogaloop.swf?clip_id=12050952&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=56872c&fullscreen=1

I want to extract 12050952.

Thanks.


Solution

  • you can do it with this pattern:

    (?<=clip_id=)\d+
    

    It is using positive lookbehind.

    Demo: example