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

Regex needed for extracting specific data from URLS/ Objects

  •  07-02-2007, 7:10 AM

    Regex needed for extracting specific data from URLS/ Objects

    Hi All,

    I am in need of a regular expression which will extract the required attributes only from a HTML tag.

    The tag which i am targetting is <embed>.

     Purpose.

    I am building a website which will show the user Video clips from Google/youtube/Msn videos / Yahoo videos and other video sharing sites.  When we upload a clip in these sites, we get an option to embed the clip in our webpage. This will be doen using Embed tag.

    Below was taken from google

     <embed style='width:400px; height:326px;' id='VideoPlayback' type='application/x-shockwave-flash' src='http://video.google.com/googleplayer.swf?docId=-7832434999576109331&hl=en" flashvars=""> </embed>

    The above data will be filled by the user in the form specified. From the data which was given by user i want to extract the attribute value SRC and flashvars. How can i do this with the help of regular expression.

     One more problem that can arise when we write the Regex. Since I am allowing the user to upload the video stream on google videos, youtube, msn videos, there is a high chance of different tag attributes.. How can we trap that.

     Friends, i don't know much in regex. I do basic string, numeric validations using regex. This one is sucking a lot of my time. Please help me in this regard

    The regular expression will be used in VB.NET and for a website.

    Albert
    http://www.bepenfriends.com

View Complete Thread