bad arg error with re:replace

Wes James comptekki@REDACTED
Thu Jul 22 00:04:45 CEST 2010


I had to add global for all instances to be changed

....[{return,list}, global])

On Wed, Jul 21, 2010 at 3:49 PM, Wes James <comptekki@REDACTED> wrote:
> I figured it out:
>
> T.
> "test\\"
> 13> re:replace(T,"\\\\","\\\\\\",[{return,list}]).
> "test\\\\"
>
> On Wed, Jul 21, 2010 at 3:11 PM, Wes James <comptekki@REDACTED> wrote:
>> I am trying to do this:
>>
>> re:replace("test\\","\\","\\\\",[{return,list}])
>>
>> but I'm getting a bad arg error.  This is assuming  for each "\" I
>> need "\\" from here:
>>
>> http://www.erlang.org/doc/man/re.html#replace-4
>>
>> I'm trying to replace each "\" with "\\".
>>
>> thx,
>>
>> -wes
>>
>


More information about the erlang-questions mailing list