John Ribe <netscapemessenger@ribe.mailshell.com> writes:
> I think this is a bug in match:substring. I revised my code to work
> around
> it, so this is just for your information, I am not looking for a fix.
>
> scsh manual says
> match:substring returns the substring matched regexp's submatch. If
> there was no match for the indexed submatch, it returns false.
>
> But this code
> (match:substring
> (string-match
> (posix-string->regexp "Job <(.*)> is submitted")
> ""
> )
> 1)
>
> Returns this error
> Error: exception
> (record-ref #f 0)
>
But this has nothing to do with MATCH:SUBSTRING. Your call to
STRING-MATCH already returns false:
> (string-match
(posix-string->regexp "Job <(.*)> is submitted")
""
)
#f
So you must not apply MATCH:SUBSTRING to the result.
--
Martin
|