[Gretl-users] Quotation marks (" ") and string manipulation

Sven Schreiber svetosch at gmx.net
Tue May 19 12:15:40 EDT 2015


Am 19.05.2015 um 18:08 schrieb Allin Cottrell:
> On Tue, 19 May 2015, Sven Schreiber wrote:
>

>>
>> At first sight from what I quickly tried to do with escaped double
>> quotes (\") in the regsub() function I would think you're right and
>> there's a bug there.
>
> There may be something going on with GLib versions here. On Linux with
> GLib 2.44.0 the following works fine:
>
> <hansl>
> string s1 = sprintf("string with \"quoted\" bit")
> print s1
> string s2 = regsub(s1, "\"", "*")
> print s2
> </hansl>
>

Yes, but if I do it the other way around:

<hansl>
string s1 = sprintf("string with *quoted* bit")
print s1
string s2 = regsub(s1, "\*", "\"")
print s2
</hansl>

then I get an error saying \" is an unknown escape sequence. Or am I 
missing something?

thanks,
sven




More information about the Gretl-users mailing list