You are here: Re: the perl regexp routines don't decode \n? « PHP Programming Language « IT news, forums, messages
Re: the perl regexp routines don't decode \n?

Posted by usenet+2004 on 09/26/84 11:59

Puzzled:

> I'm developing under W2K with PHP 4.4, and using preg_replace() to
> massage text for output.
>
> But I can't explicitly find 2 adjacent EOL tokens using /\n{2}/
>
> It works if I specify chr(13).chr(10) in place of the \n, so is it
> that it doesn't interpret the \n in an os-friendly way, or do I have
> some config thing goofed up somewhere?

If your lines end in CR LF, as your tests suggest, then /\n{2}/ would
not match EOL.

Match CR LF with /\r\n/.

--
Jock

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация