On the PHPFreaks.com blog today there's a quick new post looking at one of the special backslash strings that doesn't get talked about very much - K - but is quite powerful.
One backslash sequence that doesnâ€™t get much attention is K. What this handy little assertion does is match the position of whatever string comes before it in the pattern, then it in essence resets the match. At that point it starts a new match with whatever comes after K from the current location in the subject string.
They include a series of PHP code examples showing how use can use it to work around some of the issues with lookbehind assertions. They also include a few benefits and drawbacks of using them over lookbehinds.