I need to extract all images from HTML, not just from <img> tags, but from anywhere, including relative paths. I tried this regex:
([az\-_0-9\/\:\.]*\.(jpg|jpeg|png|gif))
.. but it fails to meet special characters. For example, in this case .
How can I capture a path so that it starts with ' (single quote), " (double quote) or / , between spaces and ends with a jpg|jpeg|png|gif image extension?
Change I use the DOM parser where possible, but here I have to use regex to extract paths from almost everywhere, including inline CSS and JS.
source share