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

Re: [TSVN] regex help

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-02-17 22:48:19 CET

Eric J. Smith wrote:
[snip]
> One interesting note is that when I test this with the .NET regex engine
> (using the awesome Regular Expression Workbench tool), this is the output
> that I get from it:
>
> Matching: issue: 1
> issues #2
[snip]
> 0 => issue: 1
> 1 => 1
> 0 => issues #2
> 1 => 2
> 0 => Issue #3,4,5
> 1 => 3
> 1 => 4
> 1 => 5
> 0 => Issue 6 and 7
> 1 => 6
> 1 => 7
> 0 => Issue #8,9, #10, #11 , and #12
> 1 => 8
> 1 => 9
> 1 => 10
> 1 => 11
> 1 => 12
> 0 => fixes #13
> 1 => 13
> 0 => fixed 14
> 1 => 14
> 0 => Fixed #15, #16, and #17
> 1 => 15
> 1 => 16
> 1 => 17
> 0 => Corrected #18 and #19
> 1 => 18
> 1 => 19
> 0 => Corrects #20 and #21
> 1 => 20
> 1 => 21
>
> So it does capture every single issue number, but the interesting part is
> that when there are multiple issues in a single match, it labels every one
> of them as group 1. I would hope that GRETA will provide you access to all
> of these groups as well. Maybe there is just some trick to enumerating
> them?

No it does not. Well, it does _while_ matching, but the results after
the match are not what we need. You can see it in the output above: the
number before the '=>' indicates the group which holds the result at the
end of the match (that's what you get, fetching groups _while_ matching
would mean interfere with the regex engine, i.e. patching it!). And you
can easily see that group number one really gets all the issue numbers,
but they're overwritten every time. The result is number 21 which is the
only number we finally get in group 1.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Feb 17 22:49:30 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.