develooper Front page | perl.perl5.porters | Postings from October 2014

[perl #122853] Guarantee 0-9, A-Z, a-z character classes

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
October 30, 2014 15:24
Subject:
[perl #122853] Guarantee 0-9, A-Z, a-z character classes
Message ID:
rt-4.0.18-20720-1414682642-183.122853-15-0@perl.org
On Thu Oct 30 06:08:46 2014, jhi wrote:
> > [\x{04}-\N{U+09}]
> 
> I think people who ask for weird things like this should be expecting
> weird results.  In other words, I wouldn't feel bad outlawing them.
> 
> The start of the range says "the 0x4 in native", the end of the range
> is "the U+09, in Unicode".  It makes no sense.  If they wanted
> native-native, they can write that.  If they wanted Unicode-Unicode,
> they can write that.

As a native ASCII speaker, I might not understand the native/Unicode distinction.

> Similarly, think of ranges like [A-z] (that's upper-A-to-lower-z), or
> [0-z] (zero-to-lower-z).  Just think in ASCII.  Should these mean
> 0x41-0x7a, and 0x30-0x7a?  If so, they *will* contain the [[\\\]_`] in
> the first case, and the [:;<=>?@\[\\\]_`] in the second.

Perl lets people do stupid things.  That is one of its strengths.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org/Ticket/Display.html?id=122853

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