From: Paolo Bonzini Date: Thu, 18 Jun 2009 06:45:37 GMT Subject: Re: [PATCH] avoid exponential regex match for java and objc function names Message-ID: <4A39E291.8030207@gmail.com> In-Reply-To: <7vab46rev0.fsf@alter.siamese.dyndns.org> > Should I remove the "/* -- */" or is it for better readability I should > keep? It helps detecting the separation between the function regex and the word regex: >> - "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$", >> + "^[ \t]*(([A-Za-z_][A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$", >> + /* -- */ I stole the idea from the Objective-C part: >> /* C functions */ >> - "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$\n" >> + "^[ \t]*(([A-Za-z_][A-Za-z_0-9]*[ \t]+)+[A-Za-z_][A-Za-z_0-9]*[ \t]*\\([^;]*)$\n" >> /* Objective-C class/protocol definitions */ >> "^(@(implementation|interface|protocol)[ \t].*)$", >> /* -- */ Paolo