preg match all - RegEx for preg_match_all in PHP -


this string ($string):

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' ], 

i match http://abc.com/aa.jpg, http://abc.com/bb.jpg, , http://abc.com/cc.jpg using preg_match_all(). how can that?

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

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -