Hello again! Andreas Schwab writes: > On Apr 06 2018, Chris Marusich wrote: > >> This is the same as before, but I've replaced "gnucash-user" with ".*". >> I expected the same result as before, but Gnus surprised me. Instead, >> gnus-summary-respool-query says: >> >> This message would go to list.user >> >> and gnus-summary-respool-trace says: >> >> ("cc" "\\(.*\\)@gnucash.org" "list.\\1") >> "list.\\1" >> >> In this case, why does the ".*" match "user" instead of "gnucash-user"? > > I think that happens because the actual regexp used for searching is > "\\(\\(FIELD\\):.*\\)\\<\\(VALUE\\)\\>", note the embedded ".*". I've tried to figure out a good way to accomplish what I want, but I'm stuck. I was hoping to come up with a "fancy" splitting method that would split the email into groups like this: foo@example-lists.com -> list.foo foo-bar@example-lists.com -> list.foo-bar foo-bar_baz@example-lists.com -> list.foo-bar_baz I currently am in a situation where I need to filter a LOT of groups like this, and I do not know a priori what their exact names will be. I could just observe the list names on emails I receive over time and add individual rules explicitly for those list names as I discover them, but if possible, I'd rather just craft a simple regexp to capture all of them up front and be done with it. How can I accomplish that? Basically, whatever comes before the @, I want to put it in the group the name. Because the greedy ".*" is foisted upon me, it eats up pretty much all of the characters in the list name. If instead of ".*" the embedded regexp used ".*?" (non-greedy), I think it would be easy to accomplish what I want with a regexp like this: "\\([[:graph:]]+\\)@example-lists.com" However, that doesn't work when the greedy ".*" precedes my regexp, since it eats up most of what I want to capture. What to do? As long as it isn't possible for me to change the regexp that precedes my own, I think the only solution is for me to embed a sentinel regexp at the start of my own regexp, to stop the greedy ".*" from going any farther. Thankfully, many of the lists I need to filter begin with a specific string that does not repeat itself later in the list name, call it "myprefix". They all look kind of like this: myprefix-foo@example-lists.com myprefix-foo-bar@example-lists.com myprefix-foo-bar_baz@example-lists.com Thanks to this happy coincidence, I suppose I can get by for now by defining a single regexp like this in my "fancy" splitting method: "\\(myprefix-[[:graph:]]+\\)@example-lists.com" But I'm curious: would there be a way to accomplish the same thing, even when the list names are not entirely predictable? Stepping back a moment, I also wonder: am I going about this the wrong way? Maybe my goal SHOULDN'T be to filter the list traffic like this. Maybe the right thing to do in this situation is actually to learn to use Gnus' "scoring" feature. Maybe I should just dump all my mail into a single group, and use the scoring feature to automatically hide the messages that I don't care about. The opinions of Gnus gurus would be very welcome. As a famous Martian once said, "I am but an egg." Thank you again for the help! -- Chris