Tcl Source Code

View Ticket
Login
Ticket UUID: 1dc8bc566ad971c5fdd0aad107151bf8ccf10f02
Title: "?" not recognized as a string in lsearch
Type: Bug Created on: 2019-06-13 06:40:25
Submitter: hant Assigned to: nobody
Subsystem: 17. Commands I-L Severity: Important
Priority: 5 Medium Last modified: 2019-06-13 08:12:08
Status: Closed Closed by: sebres
Resolution: Invalid Closed on: 2019-06-13 08:12:08
Version: 8.6.9
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:

As the documentation for lsearch says:

If all matching style options are omitted, the default matching style is -glob.
So use option -exact to avoid this:
% lsearch -exact {a ? c} "?"
1