|
From: <no...@so...> - 2000-11-10 10:59:07
|
Bug #119232, was updated on 2000-Oct-25 22:03
Here is a current snapshot of the bug.
Project: Tcl
Category: Regexp
Status: Open
Resolution: None
Bug Group: 8.3.2
Priority: 6
Summary: Error in reporting indices in regexps
Details: OriginalBugID: 4391 Bug
Version: 8.3
SubmitDate: '2000-03-17'
LastModified: '2000-03-29'
Severity: MED
Status: Assigned
Submitter: techsupp
ChangedBy: ericm
OS: Linux
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'
Name:
Laurent Riesterer
ReproducibleScript:
% regexp -nocase -all -inline -- {aa.*?(--(.*?)--|==(.*?)==).*?aa} \ "aa....--match1--........aa,,,,,,,aa....==match2==........aa"
aa....--match1--........aa --match1-- match1 {} aa....==match2==........aa ==match2== {} match2
% regexp -indices -nocase -all -inline -- {aa.*?(--(.*?)--|==(.*?)==).*?aa} \ "aa....--match1--........aa,,,,,,,aa....==match2==........aa"
{0 25} {6 15} {8 13} {-1 -1} {33 58} {39 48} {25 25} {41 46}
%
ObservedBehavior:
the empty submatch in second match reports correctly {} but
indices report {25 25} instead of {-1 -1}
DesiredBehavior:
I should can {-1 -1} for all the empty submatches in all the matches
Verified with 8.3.0 on Linux.
- eric
-- 03/29/2000 ericm
This happens in 8.2.3 as well:
% regexp -indices -start 26 {aa.*(--(.*)--|==(.*)==).*aa} "aa....--match1--........aa,,,,,,,aa....==match2==........aa" a b c d
1
% set a
33 58
% set b
39 48
% set c
25 25
% set d
41 46
Hopefully, Henry can help us out.
- eric
-- 03/29/2000 ericm
Follow-Ups:
Date: 2000-Nov-10 02:59
By: dkf
Comment:
It seems to be adding the index of the start of the match area from the second time round to each of the indices that should be -1. The following is a simpler expression of the problem, with a few extra spaces thrown in to distinguish the indices from the first match from those of the second match.
% regexp -indices -inline -all a(b(c)d|e(f)g)h abcdhaefgh
{0 4} {1 3} {2 2} {-1 -1} {5 9} {6 8} {4 4} {7 7}
You could try, as a work-around, excluding all indices that refer to indices prior to the start of the current match area. This is much less than ideal though.
-------------------------------------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=119232&group_id=10894
|