Re: Eliminating all lowercase words
| From: | Michal Migurski | Date: | Mon, 14 Jun 2004 22:41:46 +0000 |
| Subject: | Re: Eliminating all lowercase words | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188286@lists.php.net to get a copy of this message | ||
> $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