Thread backreferences und '\n' (14 answers)
Opened by snarf at 2006-03-29 15:15

renee
 2006-03-30 01:02
#64173 #64173
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Deine zwei Regexes sind nicht identisch mit dem Vorschlag von Taulmarill

Taulmarill:
Code: (dl )
1
2
3
4
5
6
C:\Dokumente und Einstellungen\Renee>perl
my $string = "test {hallo} test }";
$string =~ s/({[^}]+})/{$1}/g;
print $string;
^D
test {{hallo}} test }


Deine Lösung:
Code: (dl )
1
2
3
4
5
6
7
8
C:\Dokumente und Einstellungen\Renee>perl
my $string = "test {hallo} test }";
$string =~ s/{/{{/g;
$string =~ s/}/}}/g;
print $string;
^D
test {{hallo}} test }}
C:\Dokumente und Einstellungen\Renee>
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread backreferences und '\n'