I need a RegEx pattern for extracting all the properties of an image tag.
As we all know, there are lots of malformed HTML out there, so the pattern has to cover those possibilities.
I was looking at this solution http://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php but it didn't quite get it all:
I come up something like:
(alt|title|src|height|width)\s*=\s*["'][\W\w]+?["']
Is there any possibilities I'll be missing or a more efficient simple pattern?
EDIT:
Sorry, I will be more specific, I'm doing this using .NET so it's on the server side.
I've already a list of img tags, now I just need to parse the properties.