Commit df5993a
Fix Python regex group counting inconsistency with C# (issue #28)
Replace numbered groups with named groups to ensure consistent behavior
between C# and Python regex engines when counting inner groups.
Changes:
- Updated C# regex pattern from numbered groups ($1, $2, etc.) to named groups (${type}, ${name}, etc.)
- Updated Python regex patterns to use named group syntax (?P<name>) and backreferences (?P=name)
- Fixed all Python \k<name> backreferences to use (?P=name) syntax
- Both versions now use consistent named group patterns for maintainability
This resolves the issue where Python regex counts inner groups differently
than C# regex, ensuring both transformers produce identical results.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 6e14ad5 commit df5993a
File tree
2 files changed
+50
-50
lines changed- csharp/Platform.RegularExpressions.Transformer.CSharpToCpp
- python/cs2cpp
2 files changed
+50
-50
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments