Re: returning first paragraph from a string

From: Date: Thu, 04 Jul 2002 22:05:13 +0000
Subject: Re: returning first paragraph from a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-105501@lists.php.net to get a copy of this message
On Thu, 2002-07-04 at 15:23, Lowell Allen wrote: > > From: Analysis & Solutions <danielc@analysisandsolutions.com> > > > > How's this? > > > > $summary = preg_replace('/^(.*)(\r?\n){2,}.*/', '\\1', $summary); > > > > --Dan > > > That's great -- works, and I generally see how it works. Thanks. > > Also, can anyone recommend a good online reference, book, or tutorial for > regular expressions? O'Reilly has a book called "Mastering Regular Expressions" (I don't have the ISBN, as the book's at the office), that is VERY good. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

« previous php.general (#105501) next »