Thank you for your bug report and taking the time to make Ubuntu better.
The behaviour you are seeing is correct, the man page explicitely mentions that
ranges take the locale collation settings into account:
"Within a bracket expression, a range expression consists of two characters
separated by a hyphen. It matches any single character that sorts between the
two characters, inclusive, using the locale's collating sequence and
character set. For example, in the default C locale, [a-d] is equivalent to
[abcd]. Many locales sort characters in dictionary order, and in these locales
[a-d] is typically not equivalent to [abcd]; it might be equivalent to
[aBbCcDd], for example. To obtain the traditional interpretation of bracket
expressions, you can use the C locale by setting the LC_ALL environment
variable to the value C."
BTW, the behaviour is the same in the bash, "ls [A-Z]" will match a file
named s in your locale. For scripts -- as stated above -- LC_ALL=C
should be used.
** Changed in: grep (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/754272
Title:
Range matching incorrect in UTF-8
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/754272/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs