Skip to content
Tcl Source Code History Of Ticket 652953ffffffffff
Login

History Of Ticket 652953ffffffffff

Artifacts Associated With Ticket 652953ffffffffff

  1. Ticket change [d94b2416e3] (rid 107584) by nobody on 2002-12-12 21:51:56:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      (Greg Beauchesne, [email protected])
      
      I hope I didn't miss something, but I wanted an option
      in "regsub" that was equivalent to Perl's /e modifier
      on substitutions, and I couldn't find one. /e in Perl
      evaluates the subtitution string as code rather than as
      just a string. So, I added a -code flag to "regsub" for
      this purpose.
      
      For example, to decode a URL-encoded string, you can do:
      
      regsub -nocase -all -code -- {%([0-9a-f]{2})} $string
      {format %c 0x$1}
      
      During the substitution code, the variables $0, $1, $2,
      etc. are set to the match. If there were actual
      variables $0, $1, $2, etc. beforehand, they are
      restored at the end of the regsub command, but they are
      not accessible during the code execution. Matches which
      are unused are set to empty strings (to avoid errors).
      The replacement is done for TCL_OK and TCL_RETURN
      codes. TCL_BREAK will stop replacement prematurely (Not
      much use without -all) and TCL_ERROR or TCL_CONTINUE
      will cause the command to return TCL_ERROR.
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "regsub -code (equivalent to Perl's /e)"
    11. type initialized to: "RFE"
  2. Add attachment "regsub-code.patch" [99dc38f184] (rid 110861) by nobody on 2002-12-13 04:51:56.

  3. Ticket change [f9bc7aa6b1] (rid 91748) by nobody on 2002-12-13 04:51:57:

    1. icomment:
      
      
      File Added - 37472: regsub-code.patch
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  4. Ticket change [6a264492a9] (rid 128095) by dkf on 2002-12-13 16:58:12:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      This sort of thing has been on my to-do list for ages,
      though I've been thinking more in terms of passing things
      through the (subst) engine.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [a5c5508850] (rid 110431) by nobody on 2002-12-15 11:20:06:

    1. icomment:
      Logged In: NO 
      
      Yeah, after I submitted it, I saw your comment on the
      feature request list. It would be a small change to switch
      the use of Tcl_EvalObjEx with Tcl_SubstObj, though, yes,
      that wouldn't be compatible with the \1 \2 \3 etc. format.
      It sort of seems to me like $1 $2 $3 ... is more "natural"
      in the context of evaluated expressions, however. (as
      opposed to {[expr {\1 + \2}]} or whatever)
      
      It might be inconsistent, but it wouldn't break the
      non-substituted version.
      
      -- Greg
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  6. Ticket change [b061d6d0f7] (rid 97971) by dkf on 2002-12-17 22:04:12:

    1. assignee changed to: "nobody"
    2. subsystem changed to: "None"
  7. Ticket change [8e53b43eaf] (rid 120098) by dkf on 2003-02-23 00:28:09:

    1. assignee changed to: "dkf"
    2. subsystem changed to: "18. Commands M-Z"
  8. Ticket change [174f4cf386] (rid 122467) by dkf on 2003-03-10 05:34:33:

    1. priority changed to: "7 High"
  9. Ticket change [7f14b4ee1d] (rid 97515) by hobbs on 2003-11-12 07:25:24:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      also consider subst instead of eval: 550797
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  10. Ticket change [4f95f61682] (rid 261545) by serhiy.storchaka on 2026-11-13 11:18:45:

    1. closedate changed to: "2461357.9713335303"
    2. closer changed to: "serhiy.storchaka"
    3. icomment:
      Implemented in Tcl 9.0 as regsub -command (TIP 463): the command prefix is called with the matched string and the submatches as arguments and its result is substituted, e.g. regsub -all -command {%(..)} $s {apply {{m h} {format %c 0x$h}}}.
      
    4. login: "serhiy.storchaka"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"