Sujet : Re: perl test
De : p.dean (at) *nospam* gmx.com (Peter Dean)
Groupes : misc.test comp.lang.miscDate : 07. Sep 2024, 04:01:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbgflq$15f5c$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : tin/2.6.3-20231224 ("Banff") (Linux/6.6.49-1-lts (x86_64))
In comp.lang.misc Retro Guy <
retroguy@novabbs.com> wrote:
On Fri, 6 Sep 2024 2:14:33 +0000, Lawrence D'Oliveiro wrote:
On Sat, 31 Aug 2024 12:33:39 +0000, Retro Guy wrote:
>
I figured out my Perl issue. =~ s/([\"])/\$1/g; does the trick.
>
If that Perl code does what I think it does, the following Python
equivalent is simpler:
>
«str-expr».replace('"', '""')
The Perl code above escapes quotes, so adds '\' before any "
I know nothing of Python :)
I actually ended up with =~ s/([\$"])/\$1/g; in my final code. I needed
to escape both quotes and '$'
would it hurt to backslash everything nonalphanumeric?
perldoc -f quotemeta