Overview
| Artifact ID: | e59a96e25793b3be6f8a6e402c162579824088e1 |
|---|---|
| Ticket: | 832230ffffffffffffffffffffffffffffffffff
Function to compile a pattern |
| User & Date: | dkf on 2003-10-29 16:15:26 |
Changes
- assignee changed to: "nobody"
- closedate changed to: "2003-10-29T09:15:26"
- closer changed to: "dkf"
- 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. - login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"