Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Regular Expressions <embed> question

Last post 11-23-2007, 2:29 AM by dehseth. 1 replies.
Sort Posts: Previous Next
  •  09-25-2007, 12:30 PM 35112

    Regular Expressions <embed> question

    Howdy all, i own a mustang enthusiast's website, and i have been working with a program to embed video urls on my website.

    I find that i can put together basic tags, like such: (The below is a working example for my website)

    Site Url: http://www.brightcove.tv/title.jsp?title=1201989799&channel=416537484

    My regular expression: http://www\.brightcove\.tv/title\.jsp\?title=([\w&;=]+)

    My html: <embed src='http://www.brightcove.tv/playerswf' bgcolor='#FFFFFF' flashVars='allowFullScreen=true&initVideoId=$p1&servicesURL=http://www.brightcove.tv&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false' base='http://admin.brightcove.com' name='bcPlayer' width='486' height='412' allowFullScreen='true' allowScriptAccess='always' seamlesstabbing='false' type='application/x-shockwave-flash' swLiveConnect='true' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed>

     So the way this works, is a user can go to brightcove.tv, watch a few video's and finds one they want to share with other members. All they now have to do is grab the url from the address bar, post it as a New Thread and hit submit, and the embed video will play on my website.

     

    Now here is where i have a problem: (cannot figure out how to make 2 urls work together)

    Site url: http://www.godtube.com/view_video.php?viewkey=8f41a1d362d846af0b5e&page=1&viewtype=&category=mr

    My regular expession: http://www\.godtube\.com/view_video\.php\?viewkey=([\w]+)[&=;]

    My html:

    <embed src="http://godtube.com/flvplayer.swf" FlashVars="videoThumb=http://www.godtube.com/thumb/1_30772.jpg&flvPath=http://www.godtube.com/flvideo1/47/30772.flv" wmode="transparent" quality="high" width="330" height="270" name="flv_demo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>

    <embed src="http://godtube.com/flvplayer.swf" FlashVars="videoThumb=http://www.godtube.com/thumb/1_30772.jpg&flvPath=http://www.godtube.com/flvideo1/47/30772.flv" wmode="transparent" quality="high" width="330" height="270" name="flv_demo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>

    As you can see, this example doesn't work. The reason i have found is, it has a different embed url then the address bar url. The address bar calls for

    http://www.godtube.com/view_video.php?viewkey=8f41a1d362d846af0b5e&page=1&viewtype=&category=mr and the embed address is http://www.godtube.com/flv1/47/30772.flv

     

    Now how can i set up a regular expression that would use the address bar url, and connect to the embed url?

     

    Thanks hotwheels

    http://www.godtube.com/view_video.php?viewkey=8f41a1d362d846af0b5e&page=1&viewtype=&category=mr and the embed address is http://www.godtube.com/flv1/47/30772.flv

     

    Now how can i set up a regular expression that would use the address bar url, and connect to the embed url?

     

    Thanks hotwheels

     

  •  11-23-2007, 2:29 AM 36802 in reply to 35112

    Re: Regular Expressions <embed> question

    Can you give us examples, what do you want to match and what you dont want to match so we can help...

    You just need to explain what do you want to get with RegEx...

View as RSS news feed in XML