in reply to Re: Did regex match fail because of "end of string"?
in thread Did regex match fail because of "end of string"?

If the regex is anchored to the beginning of the string, it could fail without reaching the end. Otherwise, as far as I can imagine it would have to match every available substring* up to the end of the string.

* if the match is at least N characters long the match will fail if any of the (last - N) .. last characters of the string don't match and the subsequent characters don't have to be tested. Anyway this is equivalent to running into the end of string.

  • Comment on Re^2: Did regex match fail because of "end of string"?

Replies are listed 'Best First'.
Re^3: Did regex match fail because of "end of string"?
by moritz (Cardinal) on Oct 16, 2007 at 20:09 UTC
    Right, all matches in the tokenizer will be anchored to pos with \G.