develooper Front page | perl.perl5.porters | Postings from August 2000

Re: Proposal for \v and \V, the small- and large- cut regex operators.

Thread Previous | Thread Next
From:
Nathan Torkington
Date:
August 8, 2000 15:17
Subject:
Re: Proposal for \v and \V, the small- and large- cut regex operators.
Message ID:
14736.34519.908946.765928@prometheus.frii.com
Jeffrey Friedl writes:
> When it comes to these not-yet-existant tools, I'm worse than a novice
> because I don't even have them at my disposal to play with. That no one has
> been able to use them is not a reason to not consider them.

FWIW, it took me ages to sort out the cut in 5.6 REs because I was
expecting it to abort bumpalong.  I'd support a bumpalong-cutting
cut.

The counter-argument is that every time we permit finer control over
the behaviour of the RE engine, we remove freedom to reimplement and
improve that engine.  Already we have seemingly bizarre things:

  "hello, world" =~ /(.)(?{ print $1 })o/;

Naively you'd think it'd print
  hel
showing the RE engine trying those places, until (.) matched 'l'
and o matched 'o'.  But the fixed-string optimization causes it to
jump straight to the 'l' and immediately match.

The more we think we're writing programs for the RE engine, the more
we risk having those programs perturbed by optimizations.  Each new
RE engine feature must be weighed and balanced.

Nat

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