|
2008-10-19
| ||
| 21:02 | • Closed ticket [2178507fff]: regexp premature ending of match plus 7 other ch... artifact: 511d977df0 user: dkf | |
| 10:27 | • Ticket [2178507fff]: 4 changes artifact: dbe3148eb1 user: nobody | |
| 03:01 | • New ticket [2178507fff]. artifact: 2ba24fbc67 user: nobody | |
regexp premature ending of match
Closed / Invalid2178507fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-10-19 03:01:42
This regexp seems to not fully match the example expression where it would seem to. I'm not sure whether this is expected behaviour or not but seems so to me.
% set exp {<(.+?)> (.*)}
<(.+?)> (.*)
% set test {<hello> does this work}
<hello> does this work
% regexp $exp $test a b c
1
% set a
<hello>
% set b
hello
% set c
Works this way...:
% set exp {<(.+?)> (.*)$}
<(.+?)> (.*)$
% regexp $exp $test a b c
1
% set a
<hello> does this work
[email protected]plain2008-10-19 10:27:06
ah, looks like it's because of mixing greedy with non-greedy as per here http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/911d399d8b1d2317/4cc59fcbcde0ee7c?lnk=gst&q=greedy&pli=1
dkfplain2008-10-19 21:02:52
Working as documented? Not A Bug. (Whether or not you want the RE engine to work differently is a separate matter. I'm no RE guru, and so won't contemplate trying to alter the way the existing engine handles mixed-greediness.)
Log in (anonymous is fine) to add a comment.