preg_replace anything that isn't WORD

From: Date: Sat, 22 Aug 2009 15:32:23 +0000
Subject: preg_replace anything that isn't WORD
Groups: php.general 
Request: Send a blank email to php-general+get-297081@lists.php.net to get a copy of this message
Lets assume I have the string "cats i saw a cat and a dog" i want to strip everything except "cat" and "dog" so the result will be "catcatdog", using preg_replace. I've tried something like /[^(dog|cat)]+/ but no success What should I do? -- Use ROT26 for best security

« previous php.general (#297081) next »