Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8855f8c3d8e8d48fdd2c5896e87fbb995e72e924
Ticket: 219233ffffffffffffffffffffffffffffffffff
string match oddity when - is the last char
User & Date: dkf on 2003-11-24 23:17:10
Changes

  1. icomment:
    Logged In: YES 
    user_id=79902
    
    Backslashes aren't special inside the square-bracket term,
    so the first match doesn't match what you are expecting and
    the second match isn't looking for what you think it is:
    
    % set str \\
    \
    % string match {[\[]} $str
    1
    % set str {\]}
    \]
    % string match {[\]]} $str
    1
    
    The glob-matching engine used by [string match] isn't very
    smart...  :^(  Consider using regular expressions instead.
    
    
  2. login: "dkf"
  3. mimetype: "text/plain"
  4. username: "dkf"