#3934 regexp with escaped quantifier broken

obsolete: 8.5.1
closed-fixed
Jeffrey Hobbs
5
2008-03-10
2008-02-26
gustafn
No

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

Discussion

  • Jeffrey Hobbs
    Jeffrey Hobbs
    2008-02-26

    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.

     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2008-02-26

    • status: open --> closed-fixed
     
  • Don Porter
    Don Porter
    2008-03-10

    • milestone: --> obsolete: 8.5.1
    • assigned_to: pvgoran --> hobbs