unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sandra Snan <sandra.snan@idiomdrottning.org>
To: Lars Kotthoff <lists@larsko.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] config: allow custom separators in author lists
Date: Fri, 22 Dec 2023 23:23:06 +0100	[thread overview]
Message-ID: <87il4pri5x.fsf@ellen.idiomdrottning.org> (raw)
In-Reply-To: <170327973212.381517.8822672606278841879.kukulkan@unkai>

Lars Kotthoff <lists@larsko.org> writes: 
> Python […] I have to split the returned string, which is 
> error-prone with comma separators (e.g. name in email address is 
> of form Lastname, Firstname). 

email_list = "Diaz, Marco <m@nachos.com>, star@mewni.com, Marco 
Diaz <m@nachos.com>, star@mewni.com" addresses = [] 
current_address = ""  for char in email_list: 
    if char == ',' and '@' in current_address: 
        addresses.append(current_address.strip()) current_address 
        = "" 
    else: 
        current_address += char

addresses.append(current_address.strip())  # Adding the last 
address  print(addresses)

## prints ['Diaz, Marco <m@nachos.com>', 'star@mewni.com', 'Marco 
   Diaz <m@nachos.com>', 'star@mewni.com']

## (Trying again since use-hard-newlines borked the flow)\r

  parent reply	other threads:[~2023-12-22 22:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-22 21:15 [PATCH] config: allow custom separators in author lists Lars Kotthoff
2023-12-22 22:20 ` Sandra Snan
2023-12-22 22:23 ` Sandra Snan [this message]
2023-12-22 22:24   ` Sandra Snan
2023-12-22 23:53     ` Lars Kotthoff
2024-02-15 21:41 ` Lars Kotthoff
2024-02-16 10:28 ` Tomi Ollila
  -- strict thread matches above, loose matches on Subject: below --
2024-07-01 18:40 Lars Kotthoff
2024-07-25  8:33 ` David Bremner
2024-07-25 16:26   ` Lars Kotthoff
2024-07-26  7:06     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87il4pri5x.fsf@ellen.idiomdrottning.org \
    --to=sandra.snan@idiomdrottning.org \
    --cc=lists@larsko.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).