POSIX character classes in relation to regular expressions

commandline session

$ 4.2.20 43 543---> export LANG=en_IN
$ 4.2.20 44 544---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 45 545---> export LANG=POSIX
$ 4.2.20 46 546---> echo $LANG
POSIX
$ 4.2.20 47 547---> locale
LANG=POSIX
LANGUAGE=en_IN:en
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ 4.2.20 48 548---> ls Algorithms/[A-Z]*
ls: cannot access Algorithms/[A-Z]*: No such file or directory
$ 4.2.20 49 549---> export LANG=en_IN
$ 4.2.20 50 550---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 51 551---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 52 552---> echo $LANG
en_IN
$ 4.2.20 53 553---> export LANG=POSIX
$ 4.2.20 54 554---> echo $LANG
POSIX
$ 4.2.20 55 555---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 56 556---> export LANG=en_IN
$ 4.2.20 57 557---> ls Algorithms/[[:upper:]]*
ls: cannot access Algorithms/[[:upper:]]*: No such file or directory
$ 4.2.20 58 558---> export LANG=en_IN
$ 4.2.20 59 559---> ls Algorithms/[A]*
ls: cannot access Algorithms/[A]*: No such file or directory
$ 4.2.20 60 560---> ls Algorithms/[A-Z]*
Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 61 561---> export LANG=POSIX
$ 4.2.20 62 562---> ls Algorithms/[A-Z]*
ls: cannot access Algorithms/[A-Z]*: No such file or directory
$ 4.2.20 63 563---> echo $LANG
POSIX
$ 4.2.20 64 564---> ls Algorithms/[[:lower:]]*
Algorithms/algorithm.c	Algorithms/filereading.c  Algorithms/wordmatch.c
$ 4.2.20 100 5100--->

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s