Overview
| Artifact ID: | 86e42145a1983c48c59504984ea510954dd8360c |
|---|---|
| Ticket: | 1490503fffffffffffffffffffffffffffffffff
regexp within foreach loop matches wrong |
| User & Date: | msofer on 2006-05-18 03:59:37 |
Changes
- assignee changed to: "msofer"
- closedate changed to: "2006-05-17T20:59:37"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 The bug is actually in Tcl8.3 (although I did not confirm the behaviour there), the behaviour in 8.4 is correct. Your script is missing some braces in order to perform according to your expectation: it should be if {[regexp ...]} { send_user ">KEY $key VALUE $value\n" } elseif {[regexp ...] { send_user "KEY2 $key VALUE $value\n" } Please note that the conditions to 'if ... elseif' are enclosed in braces. This means that they are passed to 'if' as strings; when 'if' evals the first condition and finds it is true, it never evaluates the second. In your script as posted, both regexp's are evaluated *before* they are passed as arguments to 'if'; so, even when the first regexp matches, the values $key and $value are set by the second regexp. - login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "msofer"