Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ac0c9b7136dfc3eddd12aa9dce7785a6062ecaf2
Ticket: 755335ffffffffffffffffffffffffffffffffff
regsub won't substitute against an empty string
User & Date: vincentdarley on 2003-06-17 19:15:44
Changes

  1. icomment:
    Logged In: YES 
    user_id=32170
    
    Here are some new tests which ought to cover the problems 
    seen.
    
    test regexp-21.1 {regsub works with empty string} {
        regsub -- ^ {} foo
    } {foo}
    
    test regexp-21.2 {regsub works with empty string} {
        regsub -- \$ {} foo
    } {foo}
    
    test regexp-21.3 {regsub works with empty string offset} {
        regsub -start 0 -- ^ {} foo
    } {foo}
    
    test regexp-21.4 {regsub works with empty string offset} {
        regsub -start 0 -- \$ {} foo
    } {foo}
    
    test regexp-21.5 {regsub works with empty string offset} {
        regsub -start 3 -- \$ {123} foo
    } {123foo}
    
    test regexp-21.6 {regexp works with empty string} {
        regexp -- ^ {}
    } {1}
    
    test regexp-21.7 {regexp works with empty string} {
        regexp -start 0 -- ^ {}
    } {1}
    
    test regexp-21.8 {regexp works with empty string offset} {
        regexp -start 3 -- ^ {123}
    } {0}
    
    test regexp-21.9 {regexp works with empty string offset} {
        regexp -start 3 -- \$ {123}
    } {1}
    
    test regexp-21.10 {multiple matches handle newlines} {
        regsub -all -lineanchor -- {^#[^\n]
    *\n} "#one\n#two\n#three\n" foo\n
    } "foo\nfoo\nfoo\n"
    
    
    
  2. login: "vincentdarley"
  3. mimetype: "text/plain"
  4. username: "vincentdarley"