in reply to Re: C strings, unescaping of
in thread C strings, unescaping of

Thanks! The eval makes it ~10 times slower. And don't forget \" \\.

s{\\((v)|[0-7]{1,3}|.)}{$2 ? "\013" : eval qq{qq{$&}}}eg;

Replies are listed 'Best First'.
Re^3: C strings, unescaping of
by AnomalousMonk (Archbishop) on Oct 02, 2013 at 20:44 UTC
    s{\\((v)|[0-7]{1,3}|.)}{$2 ? "\013" : eval qq{qq{$&}}}eg;

    Part of the enormous speed penalty may be attributable not only to eval, but to the use of the  $& matching special variable (see Variables related to regular expressions in perlvar), which can work wonders for putting the brakes on not just an individual regex, but on the execution of every regex in an application!