++ed by:
VEESH HAMMER KES BEROV BRDUCH
7 non-PAUSE users
Author image Yuki Kimoto

NAME

SPVM::Regex::Replacer - a callback interface for the regex replacement

SYNOPSYS

  use SPVM::Regex::Replacer;
  
  my $replacer : SPVM::Regex::Replacer = sub : string ($self : self, $re : SPVM::Regex) {
    return "AB" . $re->captures->[0] . "C";
  });
  
  my $re = SPVM::Regex->new("ab(c)");
  my $string_for_replace = $replacer->($re);

DESCRIPTION

SPVM::Regex::Replacer is a callback interface for the regex replacement.

CALLBACK METHOD INTERFACE

  sub : string ($self : self, $re : SPVM::Regex)

This method return the string after the replacement.

This method is planned to be implemented in other classes.