On Mon, Jan 24, 2005 at 04:22:43PM -0000, Ronald J Kimball via RT <perlbug-followup@perl.org> wrote: > > "$" is being treated both as end-of-command and end-of-input, at different > > places in my recursive descent parser. As /\G$/ doesn't match the second > > time, the parser assumes a parse error because something is following). > > I believe this behavior is falls under the section "Repeated patterns > matching zero-length substring" in perlre. Thanks a lot, this seems to be the case indeed, and would therefore be a feature, not a bug, as it is documented. I do think it's suboptimal behaviour, though, as matching /\G$/ serves no other purpose than matching an empty string, so the reason for this behaviour does not apply (the only purpose of such a match would be an empty match). > I don't actually know whether it's supposed to behave that way in this > specific case though. According to the documentation you pointed out, it seems to behave accorfding to the specs. I don't think it makes much sense here, but finding and documenting a class of exceptions to this rule is probably not profitable (and it can be worked around with pos, as the cases where this comes up are known at development-time). > Anyway, you may be able to work around this problem by setting pos after > the first match, to clear the 'matched a zero-length substring' flag: Thanks for the hint, I'll do that. In the meantime, I think this bug report should be closed. -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPEThread Next