preg_replace help



are conditional subpatterns not allowed in the replacement string of
preg_replace()? i don't see it in the docs anywhere but my regex is
not giving me what i thought it should:

function pluralize( $singular )
{
$pattern = "/^(\w+)(?:([^aeiou])y|(x|s|z|sh|ch|[^aeiou]o))$/";
$replacement = "\\1(?(2)\\2ies|\\3es)";
echo preg_replace( $pattern, $replacement, $singular, 1 );
}

this outputs the conditional syntax literally. is it just not allowed
or am i missing something syntactically? thanks!

heath

.