Closed denizdogan closed 1 year ago
Yes, [abc^]
is valid and matches these 4 characters.
It is the usual wildmat behaviour, and explicitly part of the uwildmat specification.
You could create a test
file, and try grep
on it:
% cat test
^
^a
^b
% grep '[^^]' test
^a
^b
grep '[a^]' test
^
^a
^b
[^^]
excludes the line with only that excluded ^
char; [a^]
shows all lines with either a
or ^
.
uwildcat does not change that.
@Julien-Elie Thank you for answering! Closing this.
I've been trying to figure out this mini-language lately. Maybe the ambiguity of this is intentional, or maybe it's explicitly not defined, or maybe the answer is just "YES!"
[^abc]
would match anything that is not a, b, or c.[abc^]
match anything that is a, b, c, or ^?Many thanks!