Thread Regex-Problem mit Backreferences (44 answers)
Opened by DemoFreak at 2004-02-04 14:37

pq
 2004-02-04 16:10
#79772 #79772
User since
2003-08-04
12209 Artikel
Admin1
[Homepage]
user image
[quote=Crian,04.02.2004, 13:48]Also $2 wird auf gar keinen Fall gehen, wenn Du im Suchteil schon auf gefangene Teile zugreifen willst, musst Du die Backslashvariante nehmen.[/quote]
das ist so nicht ganz richtig, denn mittels (?{ code }) kann man das:
perl -wle '$_=23; m/(\d)(?{print "($1)"})/;'
(2)
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Regex-Problem mit Backreferences