Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1e142808a118f5d49bc7112ab196d6ee28e56d00
Ticket: 578363ffffffffffffffffffffffffffffffffff
[:xdigit:] makes RE to behave strange
User & Date: pvgoran on 2002-07-07 14:31:56
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl Version: 8.4a3
    
    Platform: Windows
    
    Code 
    sample:
    set str {2:::DebugWin32}
    set re 
    {([[:xdigit:]])([[:space:]]*)}
    puts "[regexp $re $str match xdigit 
    spaces]"
    puts "match=$match"
    puts 
    "xdigit=$xdigit"
    puts "spaces=$spaces"
    
    This 
    gives:
    1
    match=2:::DebugWin32
    xdigit=2
    spaces=:::DebugWin32
    
    Observed 
    behaviour: "spaces=:::DebugWin32"
    
    Desired behaviour: 
    "spaces="
    
    Comment:
    It looks like the [[:xdigit:]] 
    bracket expression causes the [[:space:]] bracket expression to 
    match any symbol.
    
    If [[:xdigit:]] is replaced, for example, 
    by [[:digit:]], or [[:space:]] is replaced by [[:alpha:]], all is going 
    right. (Initially, I noticed this problem with \s instead of 
    [[:space:]].)
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "pvgoran"
  9. subsystem changed to: "43. Regexp"
  10. title changed to: "[:xdigit:] makes RE to behave strange"
  11. type changed to: "Bug"