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

Re: Any opposition still to the idea of syntax indicating default regex modifiers?

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
August 12, 2010 07:00
Subject:
Re: Any opposition still to the idea of syntax indicating default regex modifiers?
Message ID:
20100812140027.GA48531@plum.flirble.org
On Thu, Aug 12, 2010 at 12:51:50PM +0100, hv@crypt.org wrote:
> Zefram <zefram@fysh.org> wrote:

[Thanks for listing the possible characters]

> :For our present purpose, I'd be happy with any of
> :
> :	_ ^ ~ * .
> 
> FWIW, I like ^, I'd be happy with ~ or *, I dislike . and _.
> 
> I quite like the mnemonic sense of ^ as "starting with a clean sheet", or
> "anchoring [the flags] to a known set", though I wouldn't suggest trying
> to mention or explain that in the documentation.

Or "from the top", and the top of the page is above instructions about
change-this-from-the-default.

> I find all of ^ ~ * to be sufficiently visually distinctive (at least in
> any font I'm used to using). I don't find any mnemonic argument for or
> against ~. I find the quantifier sense of * slightly distracting, in that
> it seems to contradict any mnemonic sense for its use in this context.
> 
> I dislike . because I don't find it sufficiently visually distinctive,
> and because it's "any" sense seems to contradict any mnemonic sense for
> its use in this context.
> 
> I dislike _ because it is a word character, and because it is not
> distinctive enough from -.

I realise that this is a bit of a bikeshed issue, but I agree with Hugo,
pretty much for the reasons that he gives.

I don't find ^ *that* confusing

1: it already has a second meaning, inside character classes
2: I already look with suspicion at any ^ used at any position other than the
   start of a regexp, as things like /(^beer|pie)/ don't do what some people
   expected

Nicholas Clark

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