Greetings,
Scsh 0.5.2 (Debian GNU/Linux sid):
> (define kala (rx (| (: (submatch "Richard") (|) "Nixon")
(submatch "bar"))))
> kala
'#{Re-submatch}
> (define jee (regexp-search kala "humbarjee"))
> jee
'#{regexp-match}
> (match:substring jee 1)
"bar"
> (match:substring jee 2)
#f
I'd expect to get:
> (match:substring jee 1)
#f
> (match:substring jee 2)
"bar"
I believe this happens because of invalid logic in
translate-submatch (posixstr.scm) that creates a tvec #(1 #f) even
though it should be #(#f 1).
--
Hannu
|