$re = '/([a-z]|[0-9]|\))([A-Z])/m';
$str = 'Washington3FinalPhiladelphia1Washington7Final (10)Philadelphia6Houston5FinalDetroit4LA Dodgers1FinalCincinnati3Oakland3FinalBaltimore2Cleveland2FinalTampa Bay0Toronto2FinalBoston7Miami5FinalNY Mets3Milwaukee0FinalChi Cubs3NY Yankees5FinalMinnesota10Chi White Sox3FinalKansas City6Pittsburgh5FinalSt. Louis11Arizona6FinalColorado3Texas0FinalLA Angels1San Diego2FinalSeattle1Atlanta4FinalSan Francisco1';
$subst = "$1|$2";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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