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

RE: [TSVN] Autocompletion list in the commit dialog

From: Eric J. Smith <eric_at_ericjsmith.net>
Date: 2005-02-16 21:55:41 CET

> There's a function 'split()' which does:
> "Use the split() method when you have a string that you want to split
> into substrings, using a regular expression as a delimiter."
>
> I guess that's what you mean?

No, that will take the entire regex pattern and use that to split the
contents of the entire file. When you look at this content and regex
pattern:

Content: "public class MyClass() {"
Pattern: "class\s+(\w+)"

What the regex engine will do is find "class" and begin matching. It will
then find the rest of the match and return "class MyClass" as a single
match.

Now, in our regex we use parens to cause the regex to create groups inside
of that single match. So in our sample case, our entire match is "class
MyClass" which is normally referred to as group 0, but then there will also
be additional groups from that single match because we used parens for
grouping. So in this case, there should be a group 1 that contains only
"MyClass". This is what we are trying to get to so that we can add that to
the auto-completion list.

In GRETA, it looks like what you are looking for is the cgroups and
cbackrefs members. Take a look at this post:

http://www.php-resource.de/forum/showthread/t-14567.html

This seems to be exactly what you need. They appear to be taking a match
and outputting the match and then also outputting the groups within that
match.

Eric J. Smith
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Feb 16 21:58:45 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.