in reply to Peeling the Peelings
The timing results where lvl=2 are:sub arg2 { my($str,$lvl)= @_; my $str1 = $str; return $str if !$lvl; # skip up to and including nth ( paren, then strip n ) parens from + end $str =~ /([^(]*\(){$lvl}(.+)(\)){$lvl}/; return $2 unless $lvl == -1; $str =~ /\(([^\(\)]+)\)+/; return $1; }
HTH, --travelerRate get_proparg arg2 get_proparg 137195/s -- -31% arg2 199115/s 45% --
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Peeling the Peelings
by bobn (Chaplain) on Jul 02, 2003 at 05:24 UTC | |
by Aristotle (Chancellor) on Jul 02, 2003 at 08:05 UTC | |
by bobn (Chaplain) on Jul 02, 2003 at 13:30 UTC | |
by tilly (Archbishop) on Jul 02, 2003 at 08:02 UTC | |
by traveler (Parson) on Jul 02, 2003 at 15:56 UTC |