Главная страница


ru.perl

 
 - RU.PERL ----------------------------------------------------------------------
 From : Ivan Frolcov                         2:5020/400     22 Sep 2000  10:29:33
 To : All
 Subject : Re: Spaces before and after
 -------------------------------------------------------------------------------- 
 
 
 dimka kuvshinov <dmitriy@genphys.phys.msu.su> wrote in message
 news:8qdbia$785$1@host.talk.ru...
 
 > IF>> $& if m/(?:\w+\s+){1,4}SUBSTRING\s+(?:\w+\s+){1,4}/;
 > IF> $& лучше без особой нужды не дергать
 >
 > ничего не понял... print $& это совпадение с шаблоном поиска... или моя
 
 мысль
 
 > отстала на несколько шагов?
 
 perlfaq6:
 ....
 Why does using $&, $`, or $' slow my program down?
 Because once Perl sees that you need one of these variables anywhere in the
 program, it has to provide them on each and every pattern match. The same
 mechanism that handles these provides for the use of $1, $2, etc., so you
 pay the same price for each regex that contains capturing parentheses. But
 if you never use $&, etc., in your script, then regexes without capturing
 parentheses won't be penalized. So avoid $&, $', and $` if you can, but if
 you can't, once you've used them at all, use them at will because you've
 already paid the price. Remember that some algorithms really appreciate
 them. As of the 5.005 release. the $& variable is no longer ``expensive''
 the way the other two are.
 ...
 --- ifmail v.2.15dev5
  * Origin: Moscow State University (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 пробелы спереди и ссзади   dimka kuvshinov   21 Sep 2000 14:36:40 
 Re: пробелы спереди и ссзади   Ivan Frolcov   21 Sep 2000 14:57:50 
 пpобелы спеpеди и ссзади   Albert N. MICHEEV   21 Sep 2000 16:07:06 
 Spaces before and after   Ivan Frolcov   21 Sep 2000 18:28:03 
 всякие хитрые регекспы   dimka kuvshinov   21 Sep 2000 20:01:17 
 Re: Spaces before and after   dimka kuvshinov   21 Sep 2000 20:05:45 
 Re: Spaces before and after   Ivan Frolcov   22 Sep 2000 10:29:33 
 Re: пробелы спереди и ссзади   dimka kuvshinov   21 Sep 2000 20:03:26 
 все ок   dimka kuvshinov   21 Sep 2000 21:10:15 
 Spaces before and after   Ivan Frolcov   22 Sep 2000 10:31:49 
Архивное /ru.perl/5486dadff408.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional