2013-05-10 4 views
0

Ceci est mon string ($ string):RegEx pour preg_match_all en PHP

swatch: http://abc.com/not_this_one.jpg, 
zoom:[ 
    'http://abc.com/aa.jpg' 
], 
large:[ 

    bbbbbbbbbbb' 
], 
swatch: http://abc.com/not_this_one.jpg, 
zoom:[ 
    'http://abc.com/bb.jpg', 

    'http://abc.com/cc.jpg' 
], 
large:[ 

    http://abc.com/also_not_this_one.jpg' 
], 

Je voudrais correspondre http://abc.com/aa.jpg, http://abc.com/bb.jpg et http://abc.com/cc.jpg en utilisant preg_match_all(). Comment puis je faire ça?

+0

Les champs autres que le zoom peuvent-ils contenir des URL? –

+2

Si c'est JSON, veuillez chercher JSON dans PHP ... – nhahtdh

+0

urls serait dans d'autres domaines. – user1610115

Répondre

0
preg_match_all('/http:\/\/abc\.com\/(?:aa|bb|cc)\.jpg/', $string, $matches);