Re: [PHP] Another preg question

2004-02-15 Thread Al
Thanks for the feedback. Here was my problem; I misunderstood how the "+" worked. It only applies to the last "\n", not both "n\n". Hans Juergen Von Lengerke wrote: From: Al <[EMAIL PROTECTED]> $text= preg_replace("/\n\n+/", "\n\n", $text); // remove excess This doesn't seem to do anythi

Re: [PHP] Another preg question

2004-02-14 Thread Hans Juergen von Lengerke
> From: Al <[EMAIL PROTECTED]> > > $text= preg_replace("/\n\n+/", "\n\n", $text); > // remove excess This doesn't seem to do anything. Strange, your code works for me: [EMAIL PROTECTED]:~ > cat foo.php [EMAIL PROTECTED]:~ > php ./foo.php before: === foo bar === after: === foo bar ===

Re: [PHP] Another preg question

2004-02-13 Thread Al
Didn't work. I'm beginning to think the problem is more involved. I am going to break out just the essentials of the code that is involved and debug just it. Thanks Matt Matijevich wrote: Next, I want to remove excessive CR/LF, [i.e. more than 2] $text= preg_replace("/\n\n+/", "\n\n",

Re: [PHP] Another preg question

2004-02-13 Thread Matt Matijevich
Next, I want to remove excessive CR/LF, [i.e. more than 2] $text= preg_replace("/\n\n+/", "\n\n", $text); // remove excess This doesn't seem to do anything. not 100% sure this is right but give it a try $text = preg_replace("/\n\n+|\n\r[\n\r]+|\r\r+/", "\n\n", $tex