|
From: | Chicken Trac |
Subject: | [Chicken-janitors] #1047: irregex extracts wrong submatches in some situations |
Date: | Sat, 24 Aug 2013 23:30:00 -0000 |
#1047: irregex extracts wrong submatches in some situations ----------------------------+----------------------------------------------- Reporter: kristianlm | Owner: sjamaan Type: defect | Status: new Priority: critical | Milestone: 4.9.0 Component: core libraries | Version: 4.8.x Keywords: | ----------------------------+----------------------------------------------- This works: {{{ (irregex-fold (irregex '(seq (* nonl) (or "kbd" (=> eventnum1 (seq "event" (+ num)))) (* nonl) (or "kbd" (=> eventnum2 (seq "event" (+ num)))) (* nonl) ;;eol ) 'backtrack ) (lambda (i m s) (cons (or (irregex-match-substring m 'eventnum1 ) (irregex-match-substring m 'eventnum2 )) s)) '() "kbd event11\nkbd event10\nkbd event9") }}} But if you remove {{{'backtrack}}} it misses the last "1" digit. -- Ticket URL: <http://bugs.call-cc.org/ticket/1047> Chicken Scheme <http://www.call-with-current-continuation.org/> Chicken Scheme is a compiler for the Scheme programming language.
[Prev in Thread] | Current Thread | [Next in Thread] |