[VPM] precompiled regex's that replace (s/)

Peter Scott Peter at PSDT.com
Mon Nov 24 09:25:31 PST 2008


At 08:33 PM 11/22/2008, Jer A wrote:


>hello all,
>
>precompiled regular expressions can help speed up repetition of a 
>regex, when looking for a match, in a loop.
>how do I precompile regex's that do to substitutions (string replace)?

Jeremy,

In general, you don't need to.  Perl precompiles the regex for you, 
unless it contains a variable that changes during the loop.  See FAQ 6.17.
-- 
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/
http://www.perlmedic.com/




More information about the Victoria-pm mailing list