In your two examples, the regex engine could find a successful match using the first "k" of your string. In such a case, it will simply report success and will not try anything to get a longer match by backtracking to the second "k".
In reply to Re: basic question: regular expression
by Laurent_R
in thread basic question: regular expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |