develooper Front page | perl.perl5.porters | Postings from February 2007

Re: unicode regex performance (was Re: Future Perl development)

From:
demerphq
Date:
February 8, 2007 04:38
Subject:
Re: unicode regex performance (was Re: Future Perl development)
Message ID:
9b18b3110702080438y6577df0dm74c1025d607cc35@mail.gmail.com
On 2/8/07, Juerd Waalboer <juerd@convolution.nl> wrote:
> demerphq skribis 2007-02-08 13:19 (+0100):
> > >By the way - I retract that a pragma would be good. I should have
> > >proposed a regex flag. Unfortunately, /i (ignorant mode) is taken, so
> > >perhaps /d (dumb) or /n (naive).
> > Eeek. New modifiers are trouble.
> > Id prefer to see this happen automatically when the pattern is utf8
> > and exact and doesnt use charclasses or anything that needs true
> > character semantics.
>
> Isn't doing this automatically very very dangerous, because pos() no
> longer makes any sense once you start using byte semantics on character
> strings?

Not sure. Since pos would only be updated on a successful match, and
both the pattern and string would be in utf8 doesnt it mean that the
pos would be set to a valid utf8 sequence start?

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



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