Thread RegEx: Platzhalter ersetzen klappt nicht (32 answers)
Opened by Lightman at 2007-04-07 21:40

bloonix
 2007-04-11 19:35
#75745 #75745
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Jauh, das stimmt. Der Matched ja auf jeden Fall.

Nun, das bekommst du sehr einfach weg...

Code: (dl )
1
2
3
4
5
$row =~ s/<%\s*(\w+)\s*%>/&replace($1)/eg;

sub replace {
  return defined $vars{$_[0]} ? $vars{$_[0]} : '';
}


aber mal ne andere Frage... was machst du eigentlich mit Keys,
die Zeichen besitzen, die nicht mit \w gematched werden?
Als Key kann man ja nehmen was man möchte. :)\n\n

<!--EDIT|opi|1176305757-->
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread RegEx: Platzhalter ersetzen klappt nicht