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

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

Thread Previous | Thread Next
From:
ilmari
Date:
November 14, 2014 14:35
Subject:
Re: [perl #122853] Guarantee 0-9, A-Z, a-z character classes
Message ID:
d8jtx21luj6.fsf@dalvik.ping.uio.no
Karl Williamson <public@khwilliamson.com> writes:

>> On Thu Oct 30 06:08:46 2014, jhi wrote:
>>> 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.
>>
[…]
> I don't think in terms of ASCII in such ranges, except for a-z, A-Z, and
> 0-9.  I don't believe that most programmers do either.  An example is
> the recent introduction of [A-z] into blead.  It was a typo, rather than
> the intent of the programmer.

There's a bunch of uses of [ -~] and [!-~] to mean all printable ASCII
characters (with or without space) on CPAN, and I know of several
DarkPAN uses too.

   http://grep.cpan.me/?q=\[[+!]-~\]


-- 
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen


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