[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: extension to string.gmatch (structural regular expressions)
- From: Norman Ramsey <nr@...>
- Date: Thu, 03 Jan 2008 16:30:26 -0500
> >instead of looking at a file as a sequence of lines,
> >let's generalize to allow arbitrary regular expressions
> >to mark boundaries between units.
>
> Isn't this the sort of string library function which many languages offer
> under a name such as "split"? Break a string into fields separated by some
> (possibly non-trivial) pattern (default usually something like '[ \t]*')?
>
> If so, I would welcome the addition of a split()-like method to the
> standard string library...it strikes me as one of those 'feature creeps'
> which would be sufficiently small (given that it could reuse much existing
> matching code, as you show here) but sufficiently widely and commonly used
> as to be, well...useful.
I'd be happy to have 'split'. The Lua team would probably have to
work a little harder to avoid duplicating code inside lstrlib.c, but
probably not too hard...
Norman