preg_match_all issue, need some help



I'm running a script that at one point will collect <img> tags from
some html. I've been using the following:

preg_match_all("/<img .*?>/",$html,$images);

and I thought it was working well. However, I've notice that some
things i throw at it don't work properly. It seems to be that and
image tag closing itself with "/>" doesn't work, ie <img src=".....
" /
. I'm guessing the "/" character is delimiting the regex somehow.

Admittedly I know very little about regular expressions. Anyone know
whats going on and the best way to get all the image tags? I ideally
would like the whole thing, from the <img to the final closing bracket
.



Relevant Pages

  • [Full-Disclosure] Multiple XSS vulnerabilites in PHPNuke
    ... Yes, more XSS in phpnuke... ... PHP-Nuke's rdf/rss parser doesn't strip html tags when parsing RSS files. ... strips <script> tags, it allows for events on tags. ...
    (Full-Disclosure)
  • Re: Enable script in HTTPWebRequest
    ... It would help if you posted the actual HTML you receive. ... The reason is that there is probably a script in the page that writes out ... > have when i use a browser, to parse some data from the page. ... Answer from the page is (without HTML tags): ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Navigating text string that contains HTML of a page as DOM object?
    ... with AJAX I will get a remote web page into a string. ... The first question is why are you sending more HTML to the client than is necessary? ... Remove script tags & content - necessary to cut down ...
    (comp.lang.javascript)
  • How to fix the whacky bug in C# when dynamically creating javascript.
    ... So I spent ages trying to work out what the problem was with my code ... the HTML later on - especially where there were other scripts in the ... as you can't have nested <script> tags according to the the HTML spec - ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Most efficient ebook format and fastest reader?
    ... The html tags supported by the ... The second option is to write a quick script to rip out the offending tags. ... but this one is still darn current for a general purpose encyclopedia.). ...
    (microsoft.public.pocketpc)