Syntax for xf:match() is based on W3C XML Schema Language regular expressions:
xf:match()
Syntax for xf:replace() is based on W3C XML Schema Language regular expressions plus $N in replace patterns to indicate the Nth match.
xf:replace()
$N