Re: strip out too many newlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/4/05 10:56 AM, "Sebastian" <sebastian@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx> wrote:
>> 
>>  
>> 
>>>>> [quote=user]
>>>>> foo
>>>>> [/quote]
>>>>> 
>>>>> <bunch of extra lines>
>>>>> 
>>>>> more text...
>>>>>        
>>>>> 
>> 
>>  
>> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux