anhtran anhtran - 6 months ago 4x
HTML Question

Use regex to get image URL in HTML/Js

I want to get some URLs of images in Js/HTML:

var a = "";
var b = "";

Looking for solution that will detect image url. So the output will be:



Based off the information you've given, this should work:


You can add more extensions by adding |ext after jpg. This will allow for strings with https as well.

Note: You may want to use the case insensitive modifier i to make the capture more inclusive. This would look like: