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
Post a Comment