Detecting HTML Images, Movies on a submit button Etc.

Last post 10-23-2007, 8:00 AM by matt365uk. 0 replies.
Sort Posts: Previous Next
  •  10-23-2007, 8:00 AM 34512

    Detecting HTML Images, Movies on a submit button Etc.

    Hi all

    i am wondering if anyone could help me out.

    Im trying to detect if an image or media file (wmv,wma,mpeg etc) has been placed in the text editor.

    Basically i have an approval system that allows a user if they just use plain text to have there content approved by the system straight away, but if they insert a Hyperlink, Image, media file then it puts there submission into the approval table in an sql database.

    So far i have an regular expression for detecting Hyperlinks which works but im having problems getting something to work for an image and a media file any help would be great

    Here is the regular expression for the URL Detecter

            Dim URLMatch As Match = Regex.Match(Editor1.Text, "(?<http>(http:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|Movie)*)")

    I have tryed the following Regular expressions for the image files and none of them work if anyone could help would be great or they have another solution that would be great.

    Dim imgMatch As Match = Regex.Match(Editor1.Text, "&lt;img src=&quot;abc.jpg&quot;&gt;|||&lt;img src=&quot;abc.jpg&quot;/&gt;|||&lt;ImG src=&quot;abc.jpg")
          
     Dim imgMatch As Match = Regex.Match(Editor1.Text, "&lt;(\/{0,1})img(.*?)(\/{0,1})\&gt;")

    Dim imgMatch As Match = Regex.Match(Editor1.Text, "&lt;img src=&quot;immy.jpg&quot; alt=&quot;Image&quot;&gt;|||&lt;img src=&quot;immy.jpg&quot;alt=&q")

          Dim imgMatch As Match = Regex.Match(Editor1.Text, "&lt;[iI][mM][gG]([^&gt;]*[^/&gt;]*[/&gt;]*[&gt;])")

    Regards

    Matt

    Hope this makes sense

View as RSS news feed in XML