All true... but my benchmarking as I wrote my ISO8601 showed that the
speed gained by pre-filtering by length to reduce the number of
regexps that need to be tried is substantial.
I will have to look into the dispatch stuff...
The other thing that my ISO8601 parser does is (optionally) return the
format specification and pieces of the time string (because it is not
always possible to cleanly map an ISO8601 string into a DT, but the
module tries its best). Is there a way to easily do that with Builder
that I haven't spotted yet?
-ben
On Wed, Jun 25, 2003 at 06:09:50AM -1000, Joshua Hoblitt wrote:
> On Wed, 25 Jun 2003, Ben Bennett wrote:
>
> > On Wed, Jun 25, 2003 at 06:53:10PM +1000, Iain Truskett wrote:
> > > * Joshua Hoblitt ([EMAIL PROTECTED]) [25 Jun 2003 17:59]:
> > >
> > > > But what if I use /(-?\d\d\d\d)/ as the regex and set the
> > > > length => [ qw( 4 5 ) ]? :)
> > >
> > > cvs update
> > >
> > > Your wish is my small patch.
> >
> > While you are fiddling with the lengths...
> >
> > Ok. One of the reasons that I am not using Builder is for the length
> > greater than N cases...
> >
> > For example ISO8601 has fractional formats, e.g.:
> > HH:MM:SS.ssss...
>
> You don't have to match by length. My current first release of ISO code handles the
> fractional formats. Although it's using a , as the separator. It isn't clear to
> me if ISO means ( just . or , and . as separators).
>
> > I want to be able to say this is a valid match if the length is 10 or
> > more characters.
>
> Thats what regex is for.
>
> > Of course the other reason that I am not using Builder at the moment
> > is that I allow the user to specify the types of formats that they
> > want to consider and making that work in the Builder framework seemed
> > to be more trouble than it was worth.
>
> The dispatch mechanism should allow this.
>
> -J
>
> --