[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: square bracket vs. curly brace character ranges
From: |
Greg Wooledge |
Subject: |
Re: square bracket vs. curly brace character ranges |
Date: |
Fri, 14 Sep 2012 17:03:23 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Sep 14, 2012 at 02:48:21PM -0600, Bob Proulx wrote:
> > $ ls [a-c]
> > a A b B c
>
> The expression [a-c] is really like saying [aAbBc] in your active
> locale. Using locale based character ranges outside of the C locale
> is problematic and I always avoid them.
It's even worse on some systems:
imadev:/tmp/greg$ ls [a-c]
A a Á á À à Â â Ä ä Å å Ã ã Æ æ B b C c
Never use character range expressions outside of the C locale. They
are implementation-defined, meaning you get totally unexpected results.