[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Re: cpp regex stuff

From: Douglas Stonham <dstonham_at_pennysaverusa.net>
Date: 2005-02-18 18:07:59 CET

On Fri, February 18, 2005 5:11 am, Russell Hind said:
>> The cpp files regex picks out member function names after a ::, but not
>> the class name before hand. Can this be added also?
> It also doesn't seem to like _ in member function names or class names.
> (I'm not sure how to add these. If I get a chance to have a look at
> regex then I'll try and ammend them next week if no-one does before hand)

Given I know little to nothing of cpp...

(MULTILINE) .h, .hpp = ^\s*class\s*([\w_]+)|([\w_]+)\([^\)]+\);
(MULTILINE) .cpp = ([\w_]+)::([\w_]+)

Changed to allow multiple whitespace characters before the word 'class'.
Changed to capture _ in any of the word groups
Changed to capture at least one character immediately before :: (or it
won't match at all)

Does that sound correct?

Also, is it intentional that function names are only captured if they have
at least one character in the following brackets? (e.g.
thisiscaptured(a), thisisnot())

If not, that can be simplified:
(MULTILINE) .h, .hpp = ^\s*class\s*([\w_]+)|([\w_]+)\(;

Let me know if they test out?

Thanks,

Douglas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Fri Feb 18 18:09:44 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.