Re: Eliminating all lowercase words
| From: | aajdubuc at webhart dot net | Date: | Mon, 14 Jun 2004 23:33:28 +0000 |
| Subject: | Re: Eliminating all lowercase words | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188288@lists.php.net to get a copy of this message | ||
Thanks Michal,
That's what I thought at first, but it eliminates all lowercase letters in a
capitalized word as well.
I plugged away at it and got it to work:
$search = "(\b[a-z][a-z]*?\b)";
$replace = "";
$add = preg_replace($search, $replace, $add);
Thanks for the help!
Andre
On Monday 14 June 2004 06:41 pm, Michal Migurski wrote:
> > $search "(([^\bA-Z][a-z]\b*?)*?));
> > $replace = "";
> > $add = preg_replace($search, $replace, $add);
> >
> > hWhen I tried it, it eliminated all lowercase words, and in the case of
> > the single upper case word, 'Bellingham', it retained only the capital
> > 'B' -- arrgh!
>
> You could just look for lowercase words, instead of "not-uppercase" words,
> like so:
> /\b[a-z]\w+\b/
>
> ---------------------------------------------------------------------
> michal migurski- contact info and pgp key:
> sf/ca http://mike.teczno.com/contact.html