Damian Conway <[EMAIL PROTECTED]>:
>
> It is proposed that the Perl 6 regular expression engine be extended to
> allow a regex to match against an incremental character source, rather than
> only against a fixed string.
>
> Specifically, it is proposed that a subroutine reference could be bound
> to a regular expression:
>
> sub {...} =~ /pattern/;
Maybe what we really want is lazily evaluated strings... These could
be useful in more situations than regex matching.
But then, a "string" is just a list of one thing...
Which leads me to something I've felt I wanted on several occasions:
to match, regex-style, vectors of other things besides characters.
If I could do
@tokens =~ /^[ab](de|fg)hi$/
where 'a'..'i' match elements of the list on the lhs,
i.e. typically whole lines of text, ^ anchors to the beginning
of the list, etc. The one time when I really felt I couldn't live
without this, I ended up hashing the input strings to characters
in 0..255, so that I could use actual regexes. Not only was it
a pain, but a hash space of 256 made me claustrophobic.
--
John Porter