I just realized some of my backslashes got stripeed. The correct line is:
'#\[node:(\d+)]#si' => nid_to_link('\\1'),
Thanks for the help. Apparently '\1' isn't working at all how I expected it to.
strlen($nid) is 2
If I do: substr($nid, 0, 2)
The string "478" is returned.
If I do: substr($nid, 0, 1) or substr($nid, 1, 1)
The strings "\" and "1" are returned, respectively.
I tried tinkering around with setting the substring to start at locations like -1 or 3, but to no avail. Where is "478" actually stored?!?