Evaluating XPath Expresssions

XPath Result of XPath Evaluation
count(replace('banana', '(an)*a', '#'))
1
replace('banana', '(an)*a', '#')[1]
'b#'