Tcl Source Code

View Ticket
Login
Ticket UUID: 1dc8bc566ad971c5fdd0aad107151bf8ccf10f02
Title: "?" not recognized as a string in lsearch
Type: Bug Version: 8.6.9
Submitter: hant Created on: 2019-06-13 06:40:25
Subsystem: 17. Commands I-L Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2019-06-13 08:12:08
Resolution: Invalid Closed By: sebres
    Closed on: 2019-06-13 08:12:08
Description:
"?" is not recognized in:
lsearch list "?"
example:
lsearch {a b c} "?"
==> 0
lsearch {a ? c} "?"
==> 0
lsearch -all {a b c} "?"
==> 0 1 2
User Comments: sebres added on 2019-06-13 08:12:08: (text/x-fossil-wiki)
As the documentation for <i>lsearch</i> says: <blockquote>If all matching style options are omitted, the default matching style is <b>-glob</b>.</blockquote>
So use option <b>-exact</b> to avoid this:
<pre>
% lsearch -exact {a ? c} "?"
1
</pre>