[70] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: Minor note about regexp matching

daemon@ATHENA.MIT.EDU (Fri Nov 26 09:33:55 1993 )

To: Quinn Avery <quinn@DUS.Mountain.Net>
Cc: coldstuff@MIT.EDU, ghudson@MIT.EDU
In-Reply-To: Your message of Fri, 26 Nov 93 09:09:41 -0500.
             <199311261409.AA18274@DUS.Mountain.Net> 
Date: Fri, 26 Nov 93 09:28:25 EST
From: Greg Hudson <ghudson@MIT.EDU>


> Could you possibly include the original string matched against the
> regexp pattern as the final element of the return value?  Sometimes
> one would want to simply pass the match result and extract fields
> from its indices, instead of passing both the result and the string
> originally matched against it.

I have a hard time believing that you can't do

	[@match_regexp(r, s), s];

The whole idea of having a language is so that the built-in primitives
don't have to do everything for you in exactly the way that you want.

> Maybe a companion substitute() as in MOO?

I'll look at it, and think about it.

--GBH