> If something is of a static length, use lengths.

Say I have the years 2003 and -2003.  In order to use static lengths I need to have 
two separate regexs, /(-\d\d\d\d)/ and /(\d\d\d\d)/.  If I have a lot of rules that 
need to match both negative and positive years group tags can cut the worst case 
scenario in half.  But what if I use /(-?\d\d\d\d)/ as the regex and set the length => 
[ qw( 4 5 ) ]? :)  I wonder if an optimization of this would be to internally create 
two separate specrefs with the same regex but one with a length of 4 and one with a 
length of 5?  The overhead of this may not be worth it - too bad we don't have 
compiled code.

> Note that a Dispatch parser can have a length. Which works
> as one might expect it to. Though I'm starting to have
> difficulty keeping potential combinations of things in my
> head =)

This just blows me away.

-J

--

Reply via email to