RegEx for extracting HTML Image properties
问题 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 https://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