php - can't make a preg_match right ! -


i have link inside html page.

<img id="catimage" width="250" alt="" src="http://dev-server2/image2.png" /> 

i want value of src , not getting along preg_match , of regex stuff. 1 right?

preg_match(     "/<img id=\"catimage\" width=\"[0-9]+\" alt=\"\" src=\"([[a-za-z0-9]\/-._]*)\"/",     $artist_page["content"], $matches); 

i empty array!

first , foremost, portion of regex deals src attribute doesn't account colon appears in url.

i'd suggest changing src portion (and other attribute values) instead close quote , capture between:

... src=\"([^\"]*)\" ....


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -