fizix Posted May 26, 2007 Share Posted May 26, 2007 Alright, I've created a preg_match expression that returns all object tags in a string. However, I now need to return all the object tags that DO NOT have a semicolon somewhere in them. Could anybody tell me why this isn't working? $test = preg_match_all('/<object(.*?)(?!\<\/object>/ims', $contents, $found); Thanks! Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 27, 2007 Share Posted May 27, 2007 do you have some example of what you have pulled! Quote Link to comment Share on other sites More sharing options...
fizix Posted May 27, 2007 Author Share Posted May 27, 2007 Ok, say I'm trying to pull tags from the source of . When doing a print_r on $found I get: Array ( [0] => Array ( [0] => <object width='728' height='90'>"; url += "<" + "param value='clickTAG=" + encodeURIComponent(ref_url) + "' /" + ">"; url += "<" + "embed src='" + img_url + "'"; url += " type='application/x-shockwave-flash' wmode='transparent'"; url += " flashvars='clickTAG=" + encodeURIComponent(ref_url) + "'"; url += " width='728' height='90' /" + ">"; url += "</object> [1] => <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/Ee_8IMx0uMo"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Ee_8IMx0uMo" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object> ) ) However, I only want to get the result in $found[0][1], not $found[0][0]. I want to filter it out by excluding strings with semicolons [;] from the results. Quote Link to comment Share on other sites More sharing options...
fizix Posted May 30, 2007 Author Share Posted May 30, 2007 Does anybody have ANY ideas? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 can you change the colour of the text your trying to grab Quote Link to comment Share on other sites More sharing options...
effigy Posted May 30, 2007 Share Posted May 30, 2007 #<object[^>]*>[^;]*</object>#ims Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.