Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread James Taylor
Hm, nevermind my question :) I'm not thinking straight, not enough sleep. On Wednesday 27 March 2002 02:53 pm, you wrote: > On Wed, 27 Mar 2002, James Taylor wrote: > > On Wednesday 27 March 2002 02:49 pm, you wrote: > >> On Wed, 27 Mar 2002, James Taylor wrote: > >>> I'm trying to do something t

Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread Miguel Cruz
On Wed, 27 Mar 2002, James Taylor wrote: > Ok, let me try to refine this as the big picture. User enters something into > a form. > > We take that form value and convert newlines into though nl2br. > > Then, I want the limit the number of consecutive 's a user can enter, > to avoid abuse via a

Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread James Taylor
Ok, let me try to refine this as the big picture. User enters something into a form. We take that form value and convert newlines into though nl2br. Then, I want the limit the number of consecutive 's a user can enter, to avoid abuse via a person just holding down enter for a while. $message

Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread Miguel Cruz
On Wed, 27 Mar 2002, James Taylor wrote: > On Wednesday 27 March 2002 02:49 pm, you wrote: >> On Wed, 27 Mar 2002, James Taylor wrote: >>> I'm trying to do something to the effect of this for a preg_replace >>> statement: >>> >>> $string = "Hello\n\n\n\n\n\n\nHow are you?\n\n\n\n\n\n\n\nHi"; >>> $

Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread James Taylor
This is just an example. There are some cases where I need the second option to be a regular expression, the same way that you can do in Perl regex... On Wednesday 27 March 2002 02:49 pm, you wrote: > On Wed, 27 Mar 2002, James Taylor wrote: > > I'm trying to do something to the effect of this

Re: [PHP] preg_replace - regex for replace string

2002-03-27 Thread Miguel Cruz
On Wed, 27 Mar 2002, James Taylor wrote: > I'm trying to do something to the effect of this for a preg_replace statement: > > $string = "Hello\n\n\n\n\n\n\nHow are you?\n\n\n\n\n\n\n\nHi"; > $string = preg_replace("/\n\n/", "/\n/", $string); > > > But, it appears the 'replace' portion of the fu