in reply to The "anchor" misnomer in regexes

The misunderstanding in your example comes from the non-greedynes of your pattern.

Since you did anchor your pattern to the end of the string, there is no need to make .* non greedy. To succeed the pattern-matcher must find a pattern of characters that extends all the way to the end of the string. Adding a ? only confuses the issue.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law