From: Florian Weimer Date: Thu, 05 Jul 2007 08:24:58 GMT Subject: Re: [PATCH 2/2] diff: add custom regular expressions for function names Message-ID: <87644zcl5x.fsf@mid.deneb.enyo.de> In-Reply-To: <7vwsxfe96i.fsf@assigned-by-dhcp.cox.net> * Junio C. Hamano: > I think using multiple regexp is cute, but if we do that, it > should allow people to pick from: > > public class Beer > { > int special; > public static void main(String args[]) > { > ... modified part is here ... > > with two regexp matches, say: > > /^(public|private|protectd) class (.*)/ then > /^ +.* (\w*\(.*)$/ > > and define the hunk_header format as something like: > > "\[1,2]::\[2,1]" Even that doesn't work for C++ namespaces, or nested Java classes. 8-( If you want to do it right, you need to spawn some helper program.