This answer to How do I select text nodes with jQuery? is a good start. Your approach would basically be to get all of the text nodes in your document, search for your file pattern, and replace with the hyperlinks.
Sample (you might want tweaking to strip trailing punctuation from match):
var pattern = /(^|\s)(\\\\.*?)(\s|$)/;
function linkifyRecursive(node) {
if (node.nodeType == 3) {
var text = node.nodeValue;
var match = text.match(pattern);
if (match) {
var span = document.createElement('span');
span.appendChild(document.createTextNode(
text.substr(0, match.index + match[1].length)));
var hyperlink = document.createElement('a');
hyperlink.setAttribute('href', 'file:///' + match[2].replace(/\\/g, '/'));
hyperlink.appendChild(document.createTextNode(match[2]));
span.appendChild(hyperlink);
span.appendChild(document.createTextNode(text.substr(match.index + match[0].length)));
node.parentNode.replaceChild(span, node);
}
} else if (node.localName != 'script') {
for (var i = 0, len = node.childNodes.length; i < len; ++i) {
linkifyRecursive(node.childNodes[i]);
}
}
}
linkifyRecursive(document.body);