MOO-cows Mailing List Archive


Re: regex substitution

>At 09:42 PM 3/4/96 PST, wrote:
>>>Is there a verb which does substitution based on regex pattern
>>>matching?  $string_utils:substitute doesn't, but it would be nice
>>>if it did.  If not, then does someone have some pre-written code
>>>which does this.  I'd rather not write it myself if it's already
>>>been done.  :)
>>doesn't the builtin function substitute() perform this function?
>I believe what you'd want to do is this:
>I suggest looking at the help in the Programmer's Manual under 'match' and

What I want to do is take an arbitrary string and substitute one
string for arbitrary substrings.  For example, substitute an 's' or
any number of 's's with the letter 't'.  Using sed, I'd just do a
s/ss*/t/ or s/s+/t/ (I think).  I'm going to be substituting in arbitrary
text, though, so I don't have the luxury of marking my substitutions
with %'s.

Do you know of a way to do this?

Bolie Williams IV                                             ( ^ )
Systems Administrator                                         (O O)
Rice University                                                v-v
----- - - -----

Home | Subject Index | Thread Index