On Sun, Jan 11, 2004 at 11:52:37AM +0000, Matthew Seaman wrote:
> On Sat, Jan 10, 2004 at 05:34:34PM -0800, Gary Kline wrote:
> > On Sat, Jan 10, 2004 at 11:02:18PM +0000, Matthew Seaman wrote:
> > >     perl -pi.bak -e 's/\s*\w+_\w+\.?//g;' filename
> >     The lines do indeed wrap so this does the job on a test file.
> >     I do have the re-exp book but this one is far ovr my head.
> >     What do the "\s*" mean, and also thr "\.?/" ?

        Thanks for your tutorial.  Time to re-read Jeff Friedl's
        book.  I'd forgotten some of perl's regex rules--specifically,
        's' and 'w'; was headsratching what symbolized whitespace.
        Also did not realize the "\w+_" would match one-or-more
        underscores.  To me, this is the genius of the expression.

        I have a 994 perl script called reflow that does an 
        outstanding job of formatting std ASCII|8859-N text. 
        I filter any essay thru a program, joinlines, and reflow
        before handing it off to OpenOffice.  What reflow doesn't
        do is to put two spaces between sentences.  That's on 
        my to-hack list:)

        have a good one,


   Gary Kline     [EMAIL PROTECTED]   www.thought.org     Public service Unix

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to