Leser: 2
10 Einträge, 1 Seite |
$regex = qr!s/.*/replaced/gi!;
$text =~ qr{ $regex };
1
2
3
4
my $muster = qr{.*};
my $ersatz = 'replaced';
my $text = 'original';
$text =~ s/$muster/$ersatz/;
1
2
3
4
my $var = 'blubb';
my $re = qr~$var~;
my $txt = 'blubber blub blubb';
$txt =~ s~$re~schnapp~g;
1
2
3
my $pattern = "foo\sbar";
my $replace = "FirstUniversalCyberneticKeneticUltramicroProgrammer";
$pattern =~ s#$pattern#$replace#;
10 Einträge, 1 Seite |