Designer? Programmer? Enthusiast? Join Open Designs Now!

Open Designs Forum » Site News

Regex Help

(3 posts)
  • Started 2 years ago by conartistdesigns
  • Latest reply from uberlemurguy

No tags yet.

  1. So i was reading that "Cature Video Topic" and its funny because thats what ive been working on all day. I am making a video downloader/proxy for youtube vidoes. And im having some trouble. I need to grab the "video_id" and the "signature" from a youtube page and I'm hainging some regex trouble. The Array keeps returning empty.
    here is my code, i know its rough.


    <?php
    if($_POST){
    $string = file_get_contents($_POST['youtube']);
    $pattern = '/^var swfArgs = {.*};$/';
    $json = preg_match($pattern, $string, $jsonmatch);
    print_r($jsonmatch);
    ?>

    Posted 2 years ago #
  2. fixed. wasn't escaping curlies

    Posted 2 years ago #
  3. uberlemurguy
    Moderator

    It looks like you are planning on using this in AJAX and eventually returning results in JSON. Javascript has its own regex implementation.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.