A little while back I answered this question on SO, but I still haven't figured out why my answer worked.
For some reason, a negative lookahead for the start of a string behaves the same as a negative lookbehind.
For example, in PHP
preg_replace("/(?!^)12/", "ab", "12345"); // 12345
preg_replace("/(?<!^)12/", "ab", "12345"); // 12345
preg_replace("/(?!1)23/", "ab", "12345"); // 1ab45
preg_replace("/(?<!1)23/", "ab", "12345"); // 12345
I know it's not the most useful question ever asked, but this has been nagging me for a couple of weeks.