As a regex newbie, this is frustrating me - all help appreciated. I have something like this:
<img src="https://jdfsdf.dsfsdf.sdfsd/upload/sm/dsfsdf/sdfsdf/sdfdsf.jpg" style="..." id="..">
I want it to be:
<img src="https://jdfsdf.dsfsdf.sdfsd/upload/lg/dsfsdf/sdfsdf/sdfdsf.jpg" style="..." id="..">
Basically, changing the /sm/ to /lg/. I'd like to do this via RegEx in PHP, and I'm using http://www.phpliveregex.com/ to test.
I could do this simply, but with less robustness, using a simple PHP str_replace - for the sake of this question I'd like to keep the answers using RegEx.
I have tried to use a look-behind, like below:
(?<=<img src.+upload\/)sm
This obviously doesn't work, but the code below does match to the desired point.
<img src.+upload\/
I'm stumped. Any assistance or links to a decent tutorial that covers this would be greatly appreciated.