develooper Front page | perl.perl6.internals | Postings from January 2002

RE: parrot rx engine

Thread Previous | Thread Next
From:
Hong Zhang
Date:
January 31, 2002 11:42
Subject:
RE: parrot rx engine
Message ID:
400CE9390E334A4393CEECDD6863120A01A1076F@ussccm003.corp.palm.com
> But as you say, case folding is expensive. And with this approach you
> are going to case-fold every string that is matched against an rx
> that has some part of it that is case-insensitive.

That is correct in general. But regex compiler can be smarter than that.
For example, rx should optimize /a+/i to /[aA]+/ to avoid case-folding.
If it is too difficult for rx to do case-folding, I think it is better
to use some normalizer to do full-case folding.

> The case-folding should be done in the rx itself, at compile time if
possible.
> Then it is only done once, which will save a lot of time if the rx happens
> to be used in a loop or something.

The regular expression itself is case-folded at compile time. But I am
talking about input string here, not re.

Hong

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About