From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87935 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Marusich Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap-split-fancy: regexp ".*" matches less than expected Date: Sun, 08 Apr 2018 11:55:24 -0700 Message-ID: <87vad1le8z.fsf@gmail.com> References: <87po3br1k1.fsf@gmail.com> <87h8on9ydh.fsf@linux-m68k.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1523213676 31447 195.159.176.226 (8 Apr 2018 18:54:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Apr 2018 18:54:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cc: ding@lists.math.uh.edu To: Andreas Schwab Original-X-From: ding-owner+m36149@lists.math.uh.edu Sun Apr 08 20:54:32 2018 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048034.atla03.us.yomura.com ([107.189.48.34]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5FSR-00084R-RJ for ding-account@gmane.org; Sun, 08 Apr 2018 20:54:32 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048034.atla03.us.yomura.com (Halon) with ESMTPS id 9162832a-3b5e-11e8-950a-b499baa2b07a; Sun, 08 Apr 2018 18:56:38 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.90_1) (envelope-from ) id 1f5FTY-0006IR-OD; Sun, 08 Apr 2018 13:55:40 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1f5FTU-0006Hl-LG for ding@lists.math.uh.edu; Sun, 08 Apr 2018 13:55:36 -0500 Original-Received: from mail-pl0-f47.google.com ([209.85.160.47]) by mx1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1f5FTS-0004na-QL for ding@lists.math.uh.edu; Sun, 08 Apr 2018 13:55:36 -0500 Original-Received: by mail-pl0-f47.google.com with SMTP id y12-v6so3686247plt.1 for ; Sun, 08 Apr 2018 11:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+9KrIKo2BJlW4AEAGrFFe5O48BSm2qjvn7JwBL7EGoY=; b=ETGMRbukjIFu3jGBxKwgs0dagHJuBs0wuYwLNEPGZzg4/iZAdJwEudJqp9aO5KJpqp iplPwsQaykdcOUwisAhLPoJ6zoE9DH2v8Zdo5NFgCTDh9h88l4MVS1eqeUTMOIlAoB5T y9CgQ17YRrEF+lbOaBN1ED+Ov6tQhutPMo5FEpwY6KNIVx8ewWoyRhAQFRSzoDGyp/Q3 kCal3gNuPe4YLdu5dfGVWHsfIhPHNOE9lzBDLwZOwMUaH6ieLJxsFd1rxm/pJQ/1Eshk EGSoadt0nq0SLPB0wqEGjT8K5TvWrt7o3DFlL6Ako7XTpuY3yI4LZc4GVi+WZsN78RNU x6NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+9KrIKo2BJlW4AEAGrFFe5O48BSm2qjvn7JwBL7EGoY=; b=rEZ0bPuwBqsKmzqmi+QDD8/HoM/AjCUJfck2rRbA/+RVjx3EL2iWagzEqNAxkzvAyr 3XVZgzOkJzilAlh9NiaTsBiRztYEaICFs/Yw6MGkKCJxdllOqoU9yEw/eo5YeiGFU8ap uV4lJgaGTyrIWEtm1jkLspigopL0aTAaw2AJWs7/QNg+zmhyb22PE0/eeBKpuZYJYtv5 E9waUjbBf5eUuolwNGk3SsX4Zer7C6TTLrJVXuflTgd7Xwabaj70OLgCpl8x1+Zq4u8j tCEASXBpIBDEHlbLJfozRu1wWYOFIs627zCvfvmPIRgJQUQUqfswciqts0fR/z8vQdwR Cr9g== X-Gm-Message-State: ALQs6tBGGbZNgKiGA8H8ykfqFgB0Jhz0z+ebl28uwXXEO19iFc+GypL4 yKzJ/h/js4uxtHyblKI6niCvGPon X-Google-Smtp-Source: AIpwx4/W26dyQ6EOTJGz9V9G8am2OtC84uGXk4WOhIzdFxGajUFMVF29aw/XuHhZvkSeGek9dsEWGw== X-Received: by 2002:a17:902:d20a:: with SMTP id t10-v6mr2392532ply.151.1523213730479; Sun, 08 Apr 2018 11:55:30 -0700 (PDT) Original-Received: from garuda.local (c-24-18-253-84.hsd1.wa.comcast.net. [24.18.253.84]) by smtp.gmail.com with ESMTPSA id y20sm27139847pfe.20.2018.04.08.11.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Apr 2018 11:55:28 -0700 (PDT) In-Reply-To: <87h8on9ydh.fsf@linux-m68k.org> (Andreas Schwab's message of "Sat, 07 Apr 2018 11:09:14 +0200") X-Spam-Score: -2.0 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87935 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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! =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlrKZZwACgkQ3UCaFdgi Rp0cMxAAvFyXYywTpI4debAlbFXs3qnOTRn9gSuJukt3QUk1yJt50PUzXA5508kD kX7mbzVhpqo1iYl91UiNhS8xqEUZHm/74ZrLKvpL0i5Sfu/Zo2OVl7J6nTi6+35U NT2h3EAsV3aQr4EqUG+S8YZS7luUQMHK6VCRUk53Y5iNV7XNNlkGbfaM3lO8VVar X68E5CETy1zpcXuYXat11FCnQwVUbi5Zep6osBC6hB7hD5GfR+bLfP4cBKjjCUmr rmiEOl7oGYxnHRHEIzzkwFH3zPWGUplfpPVaOq/BYK9Nb5Zbf6DnMQU7LgkiJm2U ShUNd6xJrUAVuncD//PNPyyty9XlKp8KReTq80Q1a0Lli5hevWe4zv8SsV5d1dzL JHEsCz93hMYzOyTuD5kttQCyUPLRjRSshm8EG5i6yXNbtB8mXh4uImFbPW8dEbF2 7+WEDE2FSGboY2KSqmr91R15vObo8C1/kBc+jJIhloAsMHeiY/aYsEwH+lw+R+H5 4TYQmiVAkBu3Txj1TxXRWgtJXZl001THnnfQ7rQyYIOi/R9H8c8xec2PIyDYJA/c B2ugHVpkxGoA0z/cn1aMo7UeslV44t+UO5jvPD4Fm+F3zoUtZAXTTS8SCSEF6lZ0 TaAowoe2ci9p+3oeJSnHr079ME9kjKEMCINV5S4onpn8fIgv97I= =xfb4 -----END PGP SIGNATURE----- --=-=-=--