TheSourceUK / tridion-2011-power-tools

Automatically exported from code.google.com/p/tridion-2011-power-tools
0 stars 0 forks source link

Patch for /trunk/PowerTools.Model/Utils/TcmUri.cs #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Pete,

I did some more testing with this Class and it turns out that that the 
Match.Groups property always return a collection with 5 items in it based on 
the RegEx and the next set of Group objects represent unnamed (numbered) 
capturing groups with our RegEx the count is always 5. In case of ComponentUri 
"tcm:15-251465" then the Group item values are as followed:
0: The entire match. 
1: 15
2: 251465
3: String.Empty
4: String.Empty

Based on these findings I've submitted the attached patch for you.
Kind regards,
Jordy Janssen

Original issue reported on code.google.com by janssen...@gmail.com on 13 Mar 2014 at 11:52

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for following up, Jordy. 

I'm surprised that we haven't run into an issue with this before, but I will 
try out the patch and incorporate it if it does what you mentioned.

Original comment by pkjaer....@gmail.com on 18 Mar 2014 at 11:57

GoogleCodeExporter commented 8 years ago
I verified that the groups are indeed filled with an empty string if they don't 
match anything - so the check for the count didn't work. I've incorporated your 
patch into the source code.

Thank you very much for your contribution!

Original comment by pkjaer....@gmail.com on 18 Mar 2014 at 1:03