InterNetNews / inn

INN (InterNetNews) Usenet server
https://www.isc.org/othersoftware/#INN
Other
68 stars 12 forks source link

Is [abc^] a valid uwildmat expression? #259

Closed denizdogan closed 1 year ago

denizdogan commented 1 year ago

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.

  1. Would [abc^] match anything that is a, b, c, or ^?
  2. If yes, is it also intentional and explicitly part of the uwildmat specification?
  3. If no, would it be considered a syntax error, or some other error?

Many thanks!

Julien-Elie commented 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.

denizdogan commented 1 year ago

@Julien-Elie Thank you for answering! Closing this.