develooper Front page | perl.perl6.language | Postings from April 2005

Re: should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?

Thread Previous | Thread Next
From:
Braňo Tichý
Date:
April 15, 2005 05:34
Subject:
Re: should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?
Message ID:
009c01c541b7$666eb880$4f4d1cc3@MATRIX
----- Original Message ----- 
From: "Aaron Sherman" <ajs@ajs.com>
To: "David Wheeler" <david@kineticode.com>
Cc: "Perl6 Language List" <perl6-language@perl.org>
Sent: Friday, April 15, 2005 2:00 PM
Subject: Re: should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?


> On Thu, 2005-04-14 at 21:32 -0700, David Wheeler wrote:
> > On Apr 14, 2005, at 7:06 PM, Patrick R. Michaud wrote:
> >
> > > So,     <[a.z]>  matches "a", ".", and "z",
> > > while   <[a..z]> matches characters "a" through "z" inclusive.
> >
> > I was going to say that that was inconsistent, but since you never need
> > to repeat a letter in a character class, well, I guess it isn't. But
> > the first person to write <[a...]> gets what's comin' to 'em.
>
> A silly question: is there a canonical character set from which we
> extract these ranges? Are we hard-coding Unicode here, or is there some
> way for the user to specify the character set for ranges?
>

<delurk>
even sillier question:
if <[a.z]> matches "a", "." and "z"
and <[a...]> matches all characters from "a" including (for some definition
of 'all')

how will be range \x21 .. \x2e written?
<[!..\.]>? (i.e. "." escaped?)
</delurk>

braňo


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