Re: regular expression question: any character except a white space?

From: lawrence (lkrubner_at_geocities.com)
Date: 02/29/04


Date: 29 Feb 2004 14:05:07 -0800

Paul Wellner Bou <paul.wellner@united-scripts.com> wrote in message news:<c1qnqh$1mejqf$1@ID-205474.news.uni-berlin.de>...
> lawrence wrote:
> > I'm bad at regular expressions. Is this how I would look for any set
> > of characters that go more than 60 characters without a white space?
> >
> > .{60}[^ ]
>
> No, almost ;-)
> take this:
>
> [^ ]{60,}

Thanks much for the response. I've promised myself I'm going to master
regex this winter, but I've still a long way to go.

 

> Are you looking for wordwrap()?
> --> www.php.net/wordwrap

As discussed in another thread I posted, I dislike wordwrap on the web
because in most situations I'm combining it with nl2br and it can lead
to jagged line edges. I don't remember why I couldn't put the wordwrap
after the nl2br, but for some reason I couldn't.