weird behaviour of regexp and "" subMatchVar's
Closed / Fixed218054ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:38
OriginalBugID: 1446 Bug
Version: 8.0.4
SubmitDate: '1999-03-04'
LastModified: '1999-07-02'
Severity: LOW
Status: Closed
Submitter: pat
ChangedBy: stanton
OS: Windows NT
OSVersion: 4.0
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '1999-07-02'
Name:
vince darley
Extensions:
none
ReproducibleScript:
% regexp {abc([a-zA-Z]+)abc} "abcblahblahabc" "" middle
1
% set ""
abcblahblahabc
ObservedBehavior:
My understanding was that "" can be used to tell regexp you don't care about a given subMatchVar, but it appears as if regexp instead sets the variable with null-name to the given match.
This behaviour is counter-intuitive, and removes the possibility of an efficiency gain which would be had by not bothering to set the "" variables which the user clearly declared they don't want.
This happens in Tcl 8.0.x and 8.1.x
07/02/1999 10:52 - stanton - "" is a valid variable name, so the behavior is correct. The user should use non-capturing parentheses in 8.1 to avoid extracting values unnecessarily
welch Closed ticket [218054ffff].
[History diff]2000-10-26 08:13:44
Log in (anonymous is fine) to add a comment.