grep - Bugs: bug #19637, \w and [[:alnum:]] not equivalent...
You are not allowed to post comments on this tracker with your current authentication level.
bug #19637: \w and [[:alnum:]] not equivalent in multibyte locale
Submitter: | None | ||
Submitted: | Fri 20 Apr 2007 08:26:28 AM UTC | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | None | Status: | None |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open |
Fri 20 Apr 2007 12:14:25 PM UTC, comment #1: |
Benno Schulenberg <bens> |
Fri 20 Apr 2007 08:26:28 AM UTC, original submission:
In grep's manpage I found:
|
Anonymous |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2010-02-06 | bonzini | Summary | \\w and [[:alnum:]] not equivalent in multibyte locale | \w and [[:alnum:]] not equivalent in multibyte locale | |
2007-04-20 | bens | Carbon-Copy | - | Added -email is unavailable- | |
2007-04-20 | bens | Carbon-Copy | Removed -email is unavailable- | - | |
2007-04-20 | bens | Carbon-Copy | - | Added -email is unavailable- |
Powered by Savane 3.13-758e.
Corresponding source code
Confirmed. So this is two bugs:
1) The man page should not say that \w equals [[:alnum:]], as the first includes also the underscore.
2) \w does not match accented characters in an utf8 locale.
$ export LC_ALL=nl_NL
$ echo -e " ee\n ëë\n __\n" | src/grep -E '\w'
ee
ëë
__
$ echo -e " ee\n ëë\n __\n" | src/grep -E '[[:alnum:]]'
ee
ëë
[switch the Konsole's encoding from iso-8859-1 to utf8 and retype the lines instead of recalling history]
$ export LC_ALL=nl_NL.utf8
$ echo -e " ee\n ëë\n __\n" | src/grep -E '\w'
ee
__
$ echo -e " ee\n ëë\n __\n" | src/grep -E '[[:alnum:]]'
ee
ëë