Deutsch English Français Italiano |
<7e23f0180a430b8429af2514ba56463b@www.novabbs.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!weretis.net!feeder8.news.weretis.net!news.neodome.net!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: Retro Guy <retroguy@novabbs.com> Newsgroups: misc.test,comp.lang.misc Subject: Re: perl test Date: Fri, 6 Sep 2024 12:06:32 +0000 Organization: Rocksolid Light Message-ID: <7e23f0180a430b8429af2514ba56463b@www.novabbs.org> References: <7e8b459c7297ad24dde92aa1fd073b21@www.novabbs.com> <877cbx4orz.fsf@tilde.institute> <51e8c77eaba5ea4084d0a234a71a4f2e@www.novabbs.com> <vbdoi9$m19l$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="1054804"; mail-complaints-to="usenet@i2pn2.org"; posting-account="gg+dDWHMzVrdxGO9Gmt8aqyeWDXqlxfqiuS0jX/WMXY"; User-Agent: Rocksolid Light X-Rslight-Posting-User: a93aefeeff923def71455caae2dbfb277a59e046 X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$UOABu3AZl49qirfUHbXHYOJoM/8oiQSxRv7gA.Y4XMpq32kTKIk0e X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5*A|XCDf ?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7|z[.9iv^g>*8_B H0=hZt'[%)4kG| Bytes: 1794 Lines: 19 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 '$' -- Retro Guy