Reputation: 3
In my HTML page I have multiple occurrences of this code:
<a onclick="window.open('hxxp://www.mysite.com/gallery/foto_amatoriali/foto_gallery_prova/foto_amatoriali.jpg');" href="javascript:void(0)">
<img height="90" alt="foto_amatoriali.jpg" src="hxxp://www.mysite.com/gallery/foto_amatoriali/foto_gallery_prova/th/foto_amatoriali_thumb.jpg" width="120" vspace="4" />
</a>
What I wanna do is with php extract all IMAGE SOURCES LINK
hxxp://www.mysite.com/gallery/foto_amatoriali/foto_gallery_prova/foto_amatoriali.jpg
Between window.open('
and ');
I created this REGEX PATTERN:
open\(\'([^()]*)\'
I tested via an online REGEX edtior and it seems to work but when I do it via php it works not correctly.
In many case it extract not only the link but LINK plus window.open('
Someone can help me with the correct REGEX syntax ?
Thanks
Upvotes: 0
Views: 71