Closed md2 closed 11 years ago
Actually, this is working as intended. Quoting from http://dinosaur.compilertools.net/lex/
1) The longest match is preferred. 2) Among rules which matched the same number of characters, the rule given first is preferred.
In your second example, the second pattern gives a longer match than the first pattern, so it is preferred.
The following code
(when processed with nex and executed as
echo name: value | ./testcase.nn
) prints...as you would expect. However, if you'll change the second nested expression to
/.+/
--it will print only
That is, in the last case the first nested expression is never matched.