http://qs321.pair.com?node_id=558888


in reply to Re^2: The craziest RegExes you ever created
in thread The craziest RegExes you ever created

can you give an example of string it needed to match against? :)

Sure, but off topic I think. It was for using in an .slrn-score file (slrn is the news reader I use). I wanted to give -100 points to posts that where sent to some es.comp.os.linux.* group and to other group outside that hierarchy.

[es.comp.os.linux.*] Score:: -100 ~Newsgroups: ^es\.comp\.os\.linux {: Newsgroups: ^es\.comp\.os\.linux Newsgroups: ,([^e]|e([^s]|s([^\.]|\.([^c]|c([^o]|o([^m]|m([^p]|p([^\.] +|\.([^o]|o([^s]|s([^\.]|\.([^l]|l([^i]|i([^n]|n([^u]|u[^x]))))))))))) +)))) }

(Yes, it seems it isn't exactly the same regex; in my previous post I copied and pasted from another file). I won't explain the whole file format but roughly, the first line means we're working with messages in e.c.o.l.* groups. The "~Newsgroups" line means that messages whose Newgroups: field didn't match ^es\.comp\.os\.linux would be scored with -100 points (since if they don't match and are in ecol, they are crossposts). Alternatively, the following block says that messages with a Newsgroups: line that matched ^es\.comp\.os\.linux and matched some other thing (for example, Newsgroups: es.comp.os.linux.misc, alt.some.other), would also be scored.

--
David Serrano