[MAGNOLIA-2659] info.magnolia.cms.beans.config.RegexpVirtualURIMapping error with high number of groups Created: 10/Mar/09 Updated: 23/Jan/13 Resolved: 29/May/09 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | None |
| Fix Version/s: | 4.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Manuel Molaschi | Assignee: | Magnolia International |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| Description |
|
I found that using a regexp with a high number of groups (>10) in a RegexpVirtualURIMapping can cause a problem when replacing group instances with matches. if you change in it works. This problem happens because the procedure replaces (in example) all "$2" occurrences making impossible to find (and replace) the "$20" |
| Comments |
| Comment by Magnolia International [ 10/Mar/09 ] |
|
Hmm, looking at the code quickly, I don't even see why we don't use the regex api to do the subsitutation; however, I'm not convinced group numbers higher than 9 will be supported in that case either. Cheers, |
| Comment by manuel.molaschi [ 11/Mar/09 ] |
|
I have a regexp with pattern Suppose that matching group n° 2 is "XXX" and n° 28 is "YYY" |
| Comment by Magnolia International [ 12/Mar/09 ] |
|
Added a testcase, and a commented out one that shows this fails with more than 9 groups. |
| Comment by Magnolia International [ 29/May/09 ] |
|
Well, patch applied; feel free to pitch in with more tests if this fails or if some corner case needs to be tested ! |