[MlMt] Submailbox string format (or, string format modifiers in general)

Benny Kjær Nielsen mailinglist at freron.com
Tue Apr 28 14:59:27 EDT 2015


On 28 Apr 2015, at 17:55, Joe Abley wrote:

> dnsop.ietf.org -> org.ietf.dnsop
> [...]
> Maybe I could do something similar with regular expressions and 
> back-references? Note that I don't know in the general case how many 
> labels are in the list-id identifier.
>
> The format string description in the manual is a bit brief. Is there a 
> way to do this?

I think your only option is regular expression, but I don't think there 
is “nice” way to do it. You'll have to match on 3, 4, 5, etc. up to 
the maximum number of items in the identifiers. I'd love to be proven 
wrong though. Here is an example with levels 3 and 4:

	${list-id.identifier/([^.]+)\.([^.]+)\.([^.]+)\.([^.]+)|([^.]+)\.([^.]+)\.([^.]+)/${4:+$4.$3.$2.$1}${7:+$7.$6.$5}/}

It first tries to match 4 and then it tries to match 3.

I hope this helps.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20150428/219573be/attachment.html>


More information about the mailmate mailing list