I'm assuming the easiest way to do this will be with regex, but I just can't seem to find clear information on regex. I'm a beginner and all the information I'm finding is confusing.
I need to find every image in an HTML file, insert the folder extension, and then overwrite the file. I know how to do everything but the replacement. From my understanding, the code should look something like this:
preg_replace("^\"(.jpg|.jpeg|.gif|.png)$"....)
But I don't understand where to go from there. I need to keep the original value of whatever is between those things and add something to the beginning of it, so for example "image.jpg" would become "images/image.jpg".