🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #2110

problem z RE (w php oczywiscie :D)

#2110
From: Trophecy
Date: Mon, 03 Sep 2001 16:45
14 lines
1452 bytes
Jak chce zamienic w Perl'u dwa backslash'e wystepujace po sobie w ciagu np.
$string ="to jest moj ciag z  \\\\";
$string =~ s/\\\\/\\/;
i jest OK. Mam pojedynczy backslash w ciagu.
W PHP chcialem to samo zrobic i wpisalem:
$ciag = preg_replace("/\\\\/","\\",$ciag);
ale to nie dziala, musze uzyc czegos takiego:
$linia = preg_replace("/\\\\\\\/","\\",$linia);
moglby mi ktos wytlumaczyc co robia te pozostale slash'e??
Doszedlem do tego bo dopisywalem slashe az sie udalo :D, ale nie rozumiem
czemu trzeba w
PHP tak to komplikowac w porownaniu z Perl'em.

THX
Technical Details
Message-ID: <9n0brr$mem$1@news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!pcmedia.com.pl!news.man.szczecin.pl!news.task.gda.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!pcmedia.com.pl!news.man.szczecin.pl!news.task.gda.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail
From: "Trophecy" <trophecy@box43.pl>
Newsgroups: pl.comp.lang.php
Subject: problem z RE (w php oczywiscie :D)
Date: Mon, 3 Sep 2001 18:45:46 +0200
Organization: tp.internet - http://www.tpi.pl
Lines: 17
Message-ID: <9n0brr$mem$1@news.tpi.pl>
NNTP-Posting-Host: pa139.olsztyn-nagorki.sdi.tpnet.pl
X-Trace: news.tpi.pl 999535291 22998 213.77.169.139 (3 Sep 2001 16:41:31 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: 3 Sep 2001 16:41:31 GMT
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit