Thread View: pl.comp.lang.php
2 messages
2 total messages
Started by RM
Mon, 14 Sep 2020 18:00
problemik z regexp
Author: RM
Date: Mon, 14 Sep 2020 18:00
Date: Mon, 14 Sep 2020 18:00
11 lines
1322 bytes
1322 bytes
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.
Re: problemik z regexp
Author: RM
Date: Tue, 15 Sep 2020 07:20
Date: Tue, 15 Sep 2020 07:20
15 lines
1550 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads