Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9c366e9ceb0ffeb41d26542d27b39e40839cfddb
Ticket: 1116050fffffffffffffffffffffffffffffffff
Regexp backreference fail with a * closure
User & Date: jkbonfield on 2005-02-04 09:27:58
Changes

  1. assignee changed to: "pvgoran"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The documentation has an example:
    
    "([bc])\1 matches bb or cc but not `bc'". So I tried:
    
    % regexp {^([bc])\1$} bb
    1
    % regexp {^([bc])\1$} cc
    1
    % regexp {^([bc])\1$} bc
    0
    
    All well and good. But what if we want b* or c* but not
    [bc]* (ie disallow bbcb). The obvious solution is \1*:
    
    % regexp {^([bc])\1*$} bbb
    1
    % regexp {^([bc])\1*$} bcb
    1
    
    bcb should not match!
    
    Oddly, using \1+ works (but means of course that "b" or
    "c" solo does not match).
    
    James
    
  4. foundin changed to: "obsolete: 8.4.9"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "jkbonfield"
  9. subsystem changed to: "43. Regexp"
  10. title changed to: "Regexp backreference fail with a * closure"
  11. type changed to: "Bug"