$re = '/ \b
((?<CASE_UPPER>[[:upper:]]+)|
(?<CASE_INITIALCAPS>[A-Z][a-z]+[A-Z]*+)|
(?<CASE_MIXED>[A-z]*[A-Z][A-z]*+)|
(?<PHRASE>[A-Z][\w-]*(\s+[A-Z][\w-]*)+))
\b/ux';
$str = 'I am testing to see if this works for UPPERCASE, InitialCase and mixedCase which of course is also mIxedcase. Firstword initial case should not be matched. FirstWordMixed case should be. UPPERCASE first word should be. And of course phrases that combine any combination of UPPER mixEd Initicase should be pulled as a phrase not a word which could be of course Initcase1 Initcase2 Initcase3. Finally it needs to match all sorto of Associations such as Association of First Words, Last Word for Association, Middle Word Association for Words.';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php