🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: problemik z regexp

#232580
From: RM
Date: Tue, 15 Sep 2020 07:20
15 lines
1550 bytes
W dniu 14.09.2020 o 20:00, RM pisze:
> Piszę obfuscator PHP. Chcę zamienić tekst:
>      $xyz = "Strona główna \\\$xyz \\\\$xyz";
> na tekst:
>      $yajguiffxs_x_x_ = "Strona główna \\\$xyz \\\\$yajguiffxs_x_x_";
> Używam wyrażeń regularnych. Próbuję takiego:
>      [^\\]?(\\\\)*\$([a-zA-Z_][a-zA-Z0-9_]+)
> jednak wtedy obfuscator zamienia mi tekst na:
>      $yajguiffxs_x_x_ = "Strona główna \\\$yajguiffxs_x_x_ 
> \\\\$yajguiffxs_x_x_";
> czyli źle, bo po trzech slashach chciałbym $xyz a nie $yajguiffxs_x_x_
> Proszę o pomoc w skonstruowaniu wyrażenia regularnego.

Już wiem: (^|[^\\])(\\\\)*\$([a-zA-Z_][a-zA-Z0-9_]+)
Działa.
Technical Details
Message-ID: <rjppv2$24ekd$1@portraits.wsisiz.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.user-5-173-136-53.play-internet.pl!not-for-mail
References: <rjob4a$1hd2m$1@portraits.wsisiz.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.user-5-173-136-53.play-internet.pl!not-for-mail
From: RM <robert_magdziarz@wp.pl>
Newsgroups: pl.comp.lang.php
Subject: Re: problemik z regexp
Date: Tue, 15 Sep 2020 09:20:01 +0200
Organization: http://www.wit.edu.pl
Message-ID: <rjppv2$24ekd$1@portraits.wsisiz.edu.pl>
References: <rjob4a$1hd2m$1@portraits.wsisiz.edu.pl>
Mime-Version: 1.0
Injection-Date: Tue, 15 Sep 2020 07:20:02 -0000 (UTC)
Injection-Info: portraits.wsisiz.edu.pl; posting-host="user-5-173-136-53.play-internet.pl:5.173.136.53"; logging-data="2243213"; mail-complaints-to="abuse@wsisiz.edu.pl"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1
In-Reply-To: <rjob4a$1hd2m$1@portraits.wsisiz.edu.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit