Re: strip out too many newlines

From: Date: Thu, 04 Aug 2005 16:02:44 +0000
Subject: Re: strip out too many newlines
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220013@lists.php.net to get a copy of this message
On 8/4/05 10:56 AM, "Sebastian" <sebastian@broadbandgaming.net> wrote: > that works for my orginal request, but i found something else: > > $string = '[quote=xx]foo[/quote]\nmore text\r\n\r\n\r\n\r\nmore text'; > Try removing double-instances of \r\n (or \n) before running the regex. Marco > now if they enter more carriage returns i get the results from above. > its no big deal, but you always have someone trying to 'break' the system. > > thanks, i really need to learn some regexp. > > Marco Tabini wrote: > >> Try changing the >> >> \n* >> >> patterns to >> >> (?:\r?\n)* >> >> Cheers, >> >> >> Marco >> >> -- >> BeebleX - The PHP Search Engine >> http://beeblex.com >> >> >> On 8/4/05 10:39 AM, "Sebastian" <sebastian@broadbandgaming.net> wrote: >> >> >> >>>>> [quote=user] >>>>> foo >>>>> [/quote] >>>>> >>>>> <bunch of extra lines> >>>>> >>>>> more text... >>>>> >>>>> >> >> >> >

« previous php.general (#220013) next »