fix xpath translate() function for RegEx special characters

for issue 4585 to fix xpath translate() function for RegEx special characters