I want to have some code run through a string of HTML source and find all of the image filenames. I will then take this list and copy the images from one folder to another. This is part of an application which allows the user to select certain pages from a site and make a CD version of them. Currently I just have the application copy all the files in the site's image folder into the folder with the CD files, but this could get out of hand as more pages get added to the site, or the user includes on of the pages that has an image gallery.
My thought process has gone like this:
~ Remove all whitespace.
~ Look for the substring "images/" (all images will be in that folder)
~ copy the next characters up until a ' or a " into and array
Once I have the array I can loop through it and copy all the image files. The thing is, I have a nagging feeling that there is a better way to do this, though I am not sure why i think that. Am I heading down the right path? Any advice is appreciated.