[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 回复: A bug in pattern matching ??
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 27 Dec 2009 11:58:57 -0200
> It is mentioned in the manual:
> "a single character class followed by '*', which matches 0 or more
> repetitions of characters in the class.
> These repetition items will always match the longest possible
> sequence;"
It does. The first match gets "abc", the longest sequence there. The
second match gets "", the longest sequence at that point.
In fact, if there is a bug, it is the reverse of what you mentioned. A
correct answer should be an infinite sequence of "@", because there are
infinite empty strings at the end of "abc".
-- Roberto