I want to understand the below XPath expression
fn:replace ($var,concat('^.*',fn:replace('.','(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')),'')
I understand
\ denotes an escape character
| denotes OR
. denotes any single character
But I am confused with the use of \$1 here. What is it referring to?