SPVM::Regex::Replacer - Interface Type for Regex Replacement Callback
use Regex::Replacer; use Regex; my $replacer = (Regex::Replacer)method : string ($re : Regex) { my $replaced_string_match = "AB" . $re->captures->[0] . "C"; return $replaced_string_match; }); my $string = "abc"; my $re = Regex->new("ab(c)"); my $replaced_string = $re->replace_all_cb($string, 0, $replacer);
Regex::Replacer is the interface type for the regex replacement callback.
required method : string ($re : Regex)
The implementation must receive a Regex object and return the string after the replacement.
To install SPVM::Regex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM::Regex
CPAN shell
perl -MCPAN -e shell install SPVM::Regex
For more information on module installation, please visit the detailed CPAN module installation guide.