I am being struggling with this regex expression long time but i cannot find any fix. I used the javascript based tools to test and write the expression. When putting into the php page and matching with preg the results are different.
/(<img\b src=)"([^"]+)"(.* class=".*colorme(?:.|[^"]*)"[^>]+>)/
And the examples to test are here, the first should not be matched. THIS ALL WORKS with javascript, but not with php, only the classes class="colorme" will be matched. Am I missing something ?
<img src="http://test.jpg" class="then" border="0" width="123" height="83">
<img src="test.jpg" border="0" alt="well watch picture" alt="tersts" class="really colorme" width="228" height="138">
<img src="test.jpeg" class="colorme then" border="0" width="123" height="83">
<img src="test" border="0" width="123" height="83" class="pic colorme then" with="me">
<img src="tests" border="0" class="colorme" width="123" height="83">