Modify

Opened 9 years ago

Last modified 9 years ago

#4221 assigned defect

multiple regexes cannot have identically named capture groups

Reported by: ComaVN Owned by: ComaVN
Priority: normal Component: RegexLinkPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When more than one regex/url pair is used, named capture groups cannot have the same name.

in trac.ini:

[regexlink]
regex1 = \bexampleA(?P<exampleid>\d+)\b
url1 = http://example.org/A\g<exampleid>
regex2 = \bexampleB(?P<exampleid>\d+)\b
url2 = http://example.org/B\g<exampleid>

result: error: redefinition of group name u'exampleid' as group 35; was group 33

Furthermore, names of capture groups could collide with named capture groups of other WikiSyntaxProvider plugins.

Names should be automatically prefixed with "regexlink_1_", "regexlink_2_", etc. in the regex and the replacement url.

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by ComaVN

Status: newassigned

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain ComaVN.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.