Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 26 Mar 2003 15:57:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 26 Mar 2003 15:57:23 -0500 Received: from mail.zmailer.org ([62.240.94.4]:59554 "EHLO mail.zmailer.org") by vger.kernel.org with ESMTP id ; Wed, 26 Mar 2003 15:57:22 -0500 Date: Wed, 26 Mar 2003 23:08:32 +0200 From: Matti Aarnio To: Linus Torvalds Cc: Matthias Andree , linux-kernel@vger.kernel.org, samel@mail.cz, ma@dt.e-technik.uni-dortmund.de Subject: Re: BK-kernel-tools/shortlog update Message-ID: <20030326210832.GC29167@mea-ext.zmailer.org> References: <20030326103036.064147C8DD@merlin.emma.line.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1199 Lines: 38 On Wed, Mar 26, 2003 at 09:21:22AM -0800, Linus Torvalds wrote: ... > Btw, one feature I'd like to see in shortlog is the ability to use > regexps for email address matching, ie something like > > 'torvalds@.*transmeta.com' => 'Linus Torvalds' > ... > 'alan@.*swansea.linux.org.uk' => 'Alan Cox' > ... ... > I don't know whether you can force perl to do something like this, but if > somebody were to try... My perl-incantation wizard friend (I consider myself mere journeyman) uses usually convoluted 'map' constructs to do things like this. It is amazing high-power way to make things -- and often helps you to make "write only" script. Wrapping converter regular expressions into map {} structure gives something like: @summary = map { s/torvalds\@.*transmeta.com/Linus Torvalds/, s/alan\@.*swansea.linux.org.uk/Alan Cox/, ... etc ... 1 } @summary; See "man perlfunc" and look for " map ". > Linus /Matti Aarnio - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/