Closed Thread Icon

Topic awaiting preservation: preg_replace doesn't replace Pages that link to <a href="https://ozoneasylum.com/backlink?for=23762" title="Pages that link to Topic awaiting preservation: preg_replace doesn&amp;#039;t replace" rel="nofollow" >Topic awaiting preservation: preg_replace doesn&#039;t replace\

 
Author Thread
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 10-22-2004 22:55

I've got a page with a bunch of preg_replace calls (I'm doing a web scraping project). All of them work except for this one:

code:
$code = preg_replace("(<b>Printer-Friendly Versions \(pdf & html\) of this Section<\/b>&nbsp;<font color=\"black\">- all combined into one document<\/a><\/small><br>)si","", $code);



The code I'm trying to pull out is:

code:
<b>Printer-Friendly Versions (pdf & html) of this Section</b>&nbsp;<font color="black">- all combined into one document</font></a></small><br>

.

I don't get an error. It just doesn't remove it. I've tried escaping just about everything I thought might be causing the problem, to no avail.

Ideas?

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 10-23-2004 02:09

There's no closing font tag in the preg



.:[ Never resist a perfect moment ]:.

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 10-23-2004 10:14

yep, bit nailed it. SInce there' no closing font tag the preg_replace can't find the specific string. It don't exist cobber. Silly mistake, I know, but we all have them, and it seems the longer you examine your code the less likely it is you'll find it. Believe me. I once spent 4 hours searching a piece of Java code for an error, only to find I'd entered 'BuggeredReader' instead of 'BufferedReader'. I only found it after I went to bed, slept and came back to it the next morning.

« BackwardsOnwards »

Show Forum Drop Down Menu