grep - Bugs: bug #34772, Backslash escape character ignored...
You are not allowed to post comments on this tracker with your current authentication level.
bug #34772: Backslash escape character ignored for \] inside [ ]
Submitter: | Thomas Käfer <kaefert> | ||
Submitted: | Tue 08 Nov 2011 06:49:03 AM UTC | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | None | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed |
Wed 28 Dec 2011 02:13:23 PM UTC, comment #3: |
Eric Blake <ericb> |
Sun 13 Nov 2011 10:54:09 AM UTC, comment #2: Ups.. Okey, thanks Eric for that detailed explanation of what my misunderstanding was. I didn't know that there are definitions of regex syntax that don't contain \ as escape character no matter where in the regex it occurs.
|
Thomas Käfer <kaefert> |
Tue 08 Nov 2011 06:27:52 PM UTC, comment #1: I'm closing this as invalid - the only bug here is your mis-understanding of the documentation.
|
Eric Blake <ericb> |
Tue 08 Nov 2011 06:49:03 AM UTC, original submission:
ls | grep "^[^\]]*$"
|
Thomas Käfer <kaefert> |
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 |
---|---|---|---|---|---|
2011-12-28 | ericb | Summary | Backslash escape character ignored for \\] inside [ ] | Backslash escape character ignored for \] inside [ ] | |
2011-11-08 | ericb | Status | None | Invalid | |
Open/Closed | Open | Closed | |||
Summary | Backslash escape character ignored for \\] inside [ ] | Backslash escape character ignored for \] inside [ ] |
Powered by Savane 3.13-4b48.
Corresponding source code
"globs" is what the shell uses: foo.* expands to any file with the first four bytes of "foo." and any number of trailing bytes.
"BRE" is Basic Regular Expression, which is what grep uses: foo.* expands to any string with the first three bytes of "foo", followed by the '.' meta-character which matches any character, occurring zero or more times.