🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #39906

Re: Podmiana znaków w stringu

#39906
From: vellezz
Date: Tue, 02 Nov 2004 17:17
27 lines
2040 bytes
Użytkownik "Szymon Sokół" <szymon@bastard.operator.from.hell.pl> napisał w
wiadomości news:cm8i4f.3vv1kbp.1@sloth.hell.pl...
> On Tue, 2 Nov 2004 17:48:14 +0100, vellezz wrote:

> >> $data->[$i]->[2] =~ s/['"]/\\"/g;
> > zerknij na posty wcześniej.
> Zerkam. Nigdzie nie napisałeś, żebyś robił właśnie tak.

Odpowiedź do post'u Bernard El-Hagin drugi wątek

> $_ = qq/to ' jest " proba '''""" "'''"'"'/;
> s/['"]/\\"/g;
> print;
>tak tak znam to :), to działa ale nie tym razem z moim stringiem robi to:
>string\\\\\\\\\\\\\\\\"

I w drugim: ostatni list z wątku. wraz z kodem oraz wynikiem kodu
>$data->[$i]->[2] =~ s/"/\\\"/g; # <<<<< coś z tym jest nie tak

przy takim regexpie jak podałeś wyrzuca mi np:
string:Bagażnik 16\\\\\\\\\\\\\\\\\\" niklowany
HEX:42616761bf6e696b2031365c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c22206e696b6c6f
77616e79
ASCII:6697103971911101051073249549292929292929292929292929292929292923432110
10510710811111997110121
zamiast: Bagażnik 16\" niklowany
Technical Details
Message-ID: <cm8fcs$1su$1@atlantis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <cm86gs$f7q$1@atlantis.news.tpi.pl> <cm8gat.3vv92v9.1@sloth.hell.pl> <cm8ds5$gc1$1@nemesis.news.tpi.pl> <cm8i4f.3vv1kbp.1@sloth.hell.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: "vellezz" <vellezz@polbox.com>
Newsgroups: pl.comp.lang.perl
Subject: Re: Podmiana znaków w stringu
Date: Tue, 2 Nov 2004 18:17:22 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 33
Message-ID: <cm8fcs$1su$1@atlantis.news.tpi.pl>
References: <cm86gs$f7q$1@atlantis.news.tpi.pl> <cm8gat.3vv92v9.1@sloth.hell.pl> <cm8ds5$gc1$1@nemesis.news.tpi.pl> <cm8i4f.3vv1kbp.1@sloth.hell.pl>
NNTP-Posting-Host: akk21.neoplus.adsl.tpnet.pl
X-Trace: atlantis.news.tpi.pl 1099415772 1950 83.26.14.21 (2 Nov 2004 17:16:12 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Tue, 2 Nov 2004 17:16:12 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit