help with preg_replace()



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)\\2ie|\\3e)s";
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

.