in reply to negative look-ahead is ignored
If you run the code with -Mre=debug you can see it first matching two digits, then matching the lookahead string (thus failing), backtracking, trying to match a single digit, then succeeding:
Setting an EVAL scope, savestack=5 0 <> <2005-12-> | 1: CURLY {4,4} DIGIT can match 4 times out of 4... Setting an EVAL scope, savestack=5 4 <2005> <-12-> | 4: EXACT <-> 5 <2005-> <12-> | 6: CURLY {1,3} DIGIT can match 2 times out of 3... Setting an EVAL scope, savestack=5 7 <2005-12> <-> | 9: UNLESSM[-0] 7 <2005-12> <-> | 11: EXACT <-> 8 <2005-12-> <> | 13: SUCCEED could match... failed... 6 <2005-1> <2-> | 9: UNLESSM[-0] 6 <2005-1> <2-> | 11: EXACT <-> failed... 6 <2005-1> <2-> | 15: END Match successful!
Dave.
|
|---|