Re: StringReplace
- To: mathgroup at smc.vnet.net
- Subject: [mg57279] Re: [mg57260] StringReplace
- From: "Oyvind Tafjord" <tafjord at wolfram.com>
- Date: Mon, 23 May 2005 02:20:49 -0400 (EDT)
- References: <200505220759.DAA01424@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
----- Original Message ----- From: "Maxim" <ab_def at prontomail.com> To: mathgroup at smc.vnet.net Subject: [mg57279] [mg57260] StringReplace > > Consider: > > In[1]:= f = StringReplace[#, s__ ~~ "1" :> f[s]]&; > > In[2]:= f["11"] // FullForm > > Out[2]//FullForm= "1\.0011" > > ("\.00" is the symbol with code 0). This happens only with recursive > definitions: Mathematica prepends the result returned from the recursive > call to the existing string instead of replacing a part of it. > > Maxim Rytin > m.r at inbox.ru There is indeed a bug in recursive string pattern matching, it will be fixed in the next release. Thanks, Oyvind Tafjord Wolfram Research
- References:
- StringReplace
- From: Maxim <ab_def@prontomail.com>
- StringReplace