facebook/libphutil — pull request #14 by yunake (2012-08-14 17:36:43+00:00)
Title: Work-around the lookbehind pcre bug

There is a bug in older versions of pcre, including the ones used on all RHEL5x based distros, that prevents from using negetaion in character class match inside lookbehind.

This simple change to negative lookbehind fixes it, however there is no lookbehind for positive match for ^. I don't think this is a problem though - the logic of such a check is not clear to me. The regex reads: look for pattern preceded by ^ OR preceded by NOT slash. But ^ satisfies the NOT slash condition. I am probably missing something but I'm not aware of any negative consequences of such a change.

Phabricator issue 179 (https://github.com/facebook/phabricator/issues/179)