MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: regex substitution
-
Date: Wed, 6 Mar 1996 22:53:41 PST
-
From: bolie@io.com (Bolie Williams IV)
-
Content-Type: text/plain; charset="us-ascii"
>At 09:06 PM 3/6/96 PST, Bolie Williams IV wrote:
>>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.
>
>Oh, I see:
>
>;strsub("What the fuck is STRSUB???","fuck","fudge")
>=> "What the fudge is STRSUB???"
That's fine... what I *want* is this:
;strsub("Can we be more patronizing?","mm*","b")
=> "Can we be bore patronizing?"
but what I get is this:
=> "Can we be more patronizing?"
I have looked at the builtins and at $string_utils and it doesn't
look like anything does that. I am curious if someone has written
something that does do this or if I'm missing something...
Bolie IV
---------------------------------------------------------------w-w---
Bolie Williams IV ( ^ )
Systems Administrator (O O)
Rice University v-v
----- bolie@io.com - bolie@rice.edu - http://www.io.com/~bolie/ -----
Home |
Subject Index |
Thread Index