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
November 14, 2014 14:35
Re: [perl #122853] Guarantee 0-9, A-Z, a-z character classes
Message ID:
Karl Williamson <> 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.\[[+!]-~\]

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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About