Subject: Regular expressions, random thought

From: [email-masked] (Erik Ostrom)
Date: Mon, 25 Jan 1993 16:16:15 -0800

>;substitute("%1", match("{foo}", "{%(.*%)}"))
=> "foo"
[used 7 ticks, 0 seconds.]
>;substitute("%1", match("{fo}", "{%(.*%)}"))
=> "fo"
[used 7 ticks, 0 seconds.]
>;substitute("%1", match("{f}", "{%(.*%)}"))
=> "f"
[used 7 ticks, 0 seconds.]
>;substitute("%1", match("{}", "{%(.*%)}"))
#-1:Input to EVAL, line 3:  Invalid argument

It seems to me the last substitute() call should return "".  Is there a good
reason why it doesn't?  (I guess I'd consider "It would require a bunch of
hacking on the GNU regexp code." a good reason, but I'd rather be shown why
the current behavior is Morally Superior.)

---

From: Pavel Curtis <[email-masked]>
Date: Mon, 25 Jan 1993 17:13:45 -0800

> Date:	Mon, 25 Jan 1993 16:16:15 -0800
> From:	[email-masked] (Erik Ostrom)

...

> It seems to me the last substitute() call should return "".

This is a known bug in our wrapper around the GNU regexp code.  It's on my list
of things that will be fixed in the next release.

	Pavel