From 8e3df2dc2c713e465cb433896a964fd067c328a0 Mon Sep 17 00:00:00 2001 From: pmichaud Date: Fri, 14 May 2010 14:55:01 -0500 Subject: [PATCH] Fix comment errors and $replace_string error in Regex.pm, noticed by cotto++ . --- src/setting/Regex.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/setting/Regex.pm b/src/setting/Regex.pm index 76cfb5f..9dc39e2 100644 --- a/src/setting/Regex.pm +++ b/src/setting/Regex.pm @@ -9,7 +9,7 @@ Regex methods and functions =begin item match Match C<$text> against C<$regex>. If the C<$global> flag is given, then return an array of all non-overlapping matches. -=end +=end item sub match ($text, $regex, :$global?) { my $match := $text ~~ regex; @@ -31,7 +31,7 @@ sub match ($text, $regex, :$global?) { Substitute an match of C<$regex> in C<$text> with C<$replacement>, returning the substituted string. If C<$global> is given, then perform the replacement on all matches of C<$text>. -=end +=end item sub subst ($text, $regex, $repl, :$global?) { my @matches := $global ?? match($text, $regex, :global) @@ -44,7 +44,7 @@ sub subst ($text, $regex, $repl, :$global?) { my $repl_string := $is_code ?? $repl($match) !! $repl; @pieces.push( pir::substr($text, $offset, $match.from - $offset)) if $match.from > $offset; - @pieces.push($replace_string); + @pieces.push($repl_string); $offset := $match.to; }