Overview
| Artifact ID: | c1c403cdb8ed5de25606f7484a3362e22cae438d |
|---|---|
| Ticket: | 1115587fffffffffffffffffffffffffffffffff
Regexp backreference fail with a * closure |
| User & Date: | tgl on 2015-09-19 16:01:47 |
Changes
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
The documentation has an example: "([bc])\1 matches bb or cc but not `bc'". So I tried: % regexp {^([bc])\1$} bb 1 % regexp {^([bc])\1$} cc 1 % regexp {^([bc])\1$} bc 0 All well and good. But what if we want b* or c* but not [bc]* (ie disallow bbcb). The obvious solution is \1*: % regexp {^([bc])\1*$} bbb 1 % regexp {^([bc])\1*$} bcb 1 bcb should not match! Oddly, using \1+ works (but means of course that "b" or "c" solo does not match). James - icomment:
See ticket http://core.tcl.tk/tcl/tktview?name=0e0e150e49479e3f for a proposed solution.
- login: "tgl"
- mimetype: "text/plain"
- severity changed to: "Minor"