Overview
| Artifact ID: | c16a5516e06ef91768e4410655534a28745bf215 |
|---|---|
| Ticket: | 1901640fffffffffffffffffffffffffffffffff
Regexp error |
| User & Date: | dkf on 2008-02-27 17:46:16 |
Changes
- icomment:
Logged In: YES user_id=79902 Originator: NO It can't match past that first colon since no backslash is put first; your RE will only match it's first part up to the first colon without a \ before it, regardless of the greediness. Indeed, in the non-greedy case it could actually stop at the first colon even if there is a \ in front of it! That first clause should be greedy for all RE engines (try matching it against some real examples if you don't believe me). The rest of it stems from the fact that the Tcl RE engine is an automata-theoretic engine that includes a strong optimization step, allowing Tcl to efficiently match things that other advanced RE engines (which tend to use recursive matchers behind the scenes) don't handle well at all. This means that the Tcl RE engine's interpretation of (non-)greediness switching is sometimes surprising. It's almost always the right thing to just use better greedy REs and get the anchoring correct; your RE is virtually there already. :-)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"