News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPFreaks.com:
PCRE Regex Spotlight K
August 25, 2009 @ 10:28:44

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.

0 comments voice your opinion now!
regularexpression regex assertion backslashk


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: The ABC's of PHP - Part 10 - The Final Installment (XML & Regex)

Matthias Noback: Test Symfony2 commands using the Process component and asynchronous assertions

NETTUTS.com: Advanced Regular Expression Tips and Techniques

Nikita Popov: Fast request routing using regular expressions

Felix Geisendorfer's Blog: Assert the yummyness of your cake


Community Events

Don't see your event here?
Let us know!


laravel series release language version introduction framework podcast laravel5 voicesoftheelephpant extension community api library example opinion interview unittest php7 list

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework