bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] How to unescape a string?


From: david kerns
Subject: Re: [bug-gawk] How to unescape a string?
Date: Tue, 23 Oct 2018 16:36:33 -0700

I was hoping this would, but it doesn't .. perhaps it will spur someone
else :/

awk 'BEGIN { a ="a\\\\b\\\""; print a; gensub(/\\(.)/, "\1", "g", a); print
a }'
a\\b\"
a\\b\"


On Tue, Oct 23, 2018 at 2:35 PM Peng Yu <address@hidden> wrote:

> Hi,
>
> I have a string in which the double quote character is escaped as \"
> (baskslash character and double quote character) and the backslash
> character is escaped as \\ (double backslash). Does anybody know a
> simple way to unescape such a string in awk? (The following is a
> simple example of the input and the output.) Thanks.
>
> a\\b\" -> a\b"
>
> --
> Regards,
> Peng
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]