git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format

From
Allen Hubbe <allenbh@gmail.com>
Date
May 26, 2015, 21:04 UTC
Message-ID
<CAJ80sau7aO9mSvBCp9TyXqeO4gS=gwsou0eX9CxmzTXcajx6rg@mail.gmail.com>
In-Reply-To
<CAPig+cQoUrAhpvyrBTFyDDjaZt8brkhhw3aehC-hNeS7gND6jw@mail.gmail.com>
On Tue, May 26, 2015 at 4:53 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 15 quoted lines
> On Tue, May 26, 2015 at 3:41 PM, Allen Hubbe <allenbh@gmail.com> wrote:
>> On Tue, May 26, 2015 at 3:10 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>> On Saturday, May 23, 2015, Allen Hubbe <allenbh@gmail.com> wrote:
>>>> +               # recognize lines that look like an alias
>>>> +               elsif (/^(\S+)\s*:\s*(.+?)$/) {
>>>
>>> Observation: Given "foo:bar:baz", this regex will take "foo:bar" as
>>> the key, and "baz" as the value, which is probably not what was
>>> intended, however, it likely doesn't matter much in this case since
>>> colon isn't legal in an email address[1].
>>
>> That's a keen observation.  I think it would work simply to use a
>> non-greedy +? in the first capture group.
>
> Yes, that would work. Alternately: /^([^\s:]+)\s*:\s*(.+?)$/
I will use the non-greedy +? because the resulting expression is easier to read.

I will remove the non-greedy +? from the second capture group. It serves no purpose there any more. It had been there to allow matching a trailing backslash after the group, but now lines with trailing backslash are ignored entirely before reaching here.

Previous: Eric Sunshine
Message 20 of 20 in “send-email: Add sendmail email aliases format”
  1. 1/1 send-email: Add sendmail email aliases formatAllen Hubbe, May 23, 2015
  2. Junio C HamanoMay 23, 2015
  3. Junio C HamanoMay 23, 2015
  4. Allen HubbeMay 23, 2015
  5. Junio C HamanoMay 23, 2015
  6. Allen HubbeMay 23, 2015
  7. Allen HubbeMay 25, 2015
  8. Junio C HamanoMay 25, 2015
  9. Junio C HamanoMay 25, 2015
  10. Junio C HamanoMay 25, 2015
  11. Allen HubbeMay 26, 2015
  12. Junio C HamanoMay 26, 2015
  13. Allen HubbeMay 26, 2015
  14. Junio C HamanoMay 26, 2015
  15. Junio C HamanoMay 26, 2015
  16. Eric SunshineMay 26, 2015
  17. Eric SunshineMay 26, 2015
  18. Allen HubbeMay 26, 2015
  19. Eric SunshineMay 26, 2015
  20. Allen HubbeMay 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.