Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-03-10
23:34 • Ticket [1902436fff] regexp with escaped quantifier broken status still Close... artifact: d6398de1d1 user: dgp
2008-02-27
03:19 • Closed ticket [1902436fff]. artifact: 7aebd17ec7 user: hobbs
2008-02-26
19:17 • New ticket [1902436fff]. artifact: c3a05ec242 user: gneumann

regexp with escaped quantifier broken

Closed / Fixed1902436fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-02-26 19:17:27
Blackslashing the * quantifier seems broken in Tcl 8.5. The documentation says that "\k matches the non-alphanumeric character k taken as an ordinary character, e.g. \\ matches a backslash character". So \* is supposed to match * literally, but it does not in Tcl 8.5. In Tcl 8.4, it works as expected.

Tcl 8.5:

  set text {this is *bold*!}
  this is *bold*!
  % regexp {\*bold\*} $text
  0
  % set ::tcl_patchLevel
  8.5.1

Tcl 8.4:

  % set text {this is *bold*!}
  this is *bold*!
  % regexp {\*bold\*} $text
  1
  % set ::tcl_patchLevel
  8.4.13


Best regards
-gustaf neumann
hobbsplain2008-02-27 03:19:08
Logged In: YES 
user_id=72656
Originator: NO

The problem was actually restricted to just the RE ending with "\*" (an escaped star) not converting right to the glob pattern.  Corrected for 8.5.2.
dgp Ticket [1902436fff]: 2 changes [History diff]2008-03-10 23:34:44
Log in (anonymous is fine) to add a comment.