simple Regex

From: Date: Thu, 07 Dec 2000 10:52:11 +0000
Subject: simple Regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29089@lists.php.net to get a copy of this message
Hello. I've this string to parse: Via Monticano Del COLLE How can I get the first three words? Logic: All words that are UCFirst_ and not words that are all CAPS regs[1] should be = "Via Monticano Del "; if(ereg("^(([A-Z]{1}[a-z0-9]+)| )? (.*)$", $test, $regs)) { echo "..." // the three words. } Thanks Nicola

« previous php.general (#29089) next »