Thread Wortgrenzen, Umlaute und reguläre Ausdrücke (8 answers)
Opened by Gast at 2008-05-27 17:07

Linuxer
 2008-05-29 00:55
#110423 #110423
User since
2006-01-27
3891 Artikel
HausmeisterIn

user image
Zur Verwendung von $&:

'perldoc perlre'
...
WARNING: Once Perl sees that you need one of $& , $` , or $' anywhere in the program, it has to provide them for every pattern match. This may substantially slow your program. Perl uses the same mechanism to produce $1, $2, etc, so you also pay a price for each pattern that contains capturing parentheses. (To avoid this cost while retaining the grouping behaviour, use the extended regular expression (?: ... ) instead.) But if you never use $& , $` or $' , then patterns without capturing parentheses will not be penalized. So avoid $& , $' , and $` if you can, but if you can't (and some algorithms really appreciate them), once you've used them once, use them at will, because you've already paid the price. As of 5.005, $& is not so costly as the other two.
...


perldoc perlre
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Wortgrenzen, Umlaute und reguläre Ausdrücke