Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e59a96e25793b3be6f8a6e402c162579824088e1
Ticket: 832230ffffffffffffffffffffffffffffffffff
Function to compile a pattern
User & Date: dkf on 2003-10-29 16:15:26
Changes

  1. assignee changed to: "nobody"
  2. closedate changed to: "2003-10-29T09:15:26"
  3. closer changed to: "dkf"
  4. icomment:
    Logged In: YES 
    user_id=79902
    
    Fleshing out with an example:
    
      set RE {the.*complex.*regexp}
      # Match once against the empty string; this forces compilation
      regexp $RE {}
      # Now use $RE instead of the literal and you'll use the
      # pre-compiled RE.
    
    In fact, there's a few other places which do caching as
    well. But IMHO the biggest advantage of the above technique
    is that you can also give logical names to your RE (e.g.
    $LinkTagMatcher instead {<a[^>]*?HREF="([^"]+)"}) and this
    is a big win in maintenance and code-simplicity terms.
    
    
  5. login: "dkf"
  6. mimetype: "text/plain"
  7. resolution changed to: "Invalid"
  8. status changed to: "Closed"
  9. username: "dkf"