Thread Anfänger-Problem: Trailing \ in Regex (3 answers)
Opened by Gast at 2008-02-05 18:48

moritz
 2008-02-05 20:57
#105601 #105601
User since
2007-05-11
923 Artikel
HausmeisterIn
[Homepage]
user image
s/\Q$_\E/$revHash{$_}/g;

Oder
Code (perl): (dl )
1
2
my $re = join '|', map { quotemeta $_ } keys %revHash;
$_[1] =~ s/($re)/$revHash{$1}/g;

View full thread Anfänger-Problem: Trailing \ in Regex