The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Object::Replace

ABSTRACT

Data-Object Replace Class

SYNOPSIS

  use Data::Object::Replace;

  my $result = Data::Object::Replace->new([
    $regexp,
    $altered_string,
    $count,
    $last_match_end,
    $last_match_start,
    $named_captures,
    $initial_string
  ]);

DESCRIPTION

Data::Object::Replace provides routines for introspecting the results of an operation involving a regular expressions. These methods work on data whose shape conforms to the tuple defined in the synopsis.

METHODS

This package implements the following methods.

captures

  my $captures = $result->captures();

The captures method returns the capture groups from the result object which contains information about the results of the regular expression operation.

count

  my $count = $result->count();

The count method returns the number of match occurrences from the result object which contains information about the results of the regular expression operation.

initial

  my $initial = $result->initial();

The initial method returns the unaltered string from the result object which contains information about the results of the regular expression operation.

last_match_end

  my $last_match_end = $result->last_match_end();

The last_match_end method returns an array of offset positions into the string where the capture(s) stopped matching from the result object which contains information about the results of the regular expression operation.

last_match_start

  my $last_match_start = $result->last_match_start();

The last_match_start method returns an array of offset positions into the string where the capture(s) matched from the result object which contains information about the results of the regular expression operation.

named_captures

  my $named_captures = $result->named_captures();

The named_captures method returns a hash containing the requested named regular expressions and captured string pairs from the result object which contains information about the results of the regular expression operation.

matched

  my $matched = $result->matched();

The matched method returns the portion of the string that matched from the result object which contains information about the results of the regular expression operation.

prematched

  my $prematched = $result->prematched();

The prematched method returns the portion of the string before the regular expression matched from the result object which contains information about the results of the regular expression operation.

postmatched

  my $postmatched = $result->postmatched();

The postmatched method returns the portion of the string after the regular expression matched from the result object which contains information about the results of the regular expression operation.

regexp

  my $regexp = $result->regexp();

The regexp method returns the regular expression used to perform the match from the result object which contains information about the results of the regular expression operation.

string

  my $string = $result->string();

The string method returns the string matched against the regular expression from the result object which contains information about the results of the regular expression operation.

ROLES

This package inherits all behavior from the folowing role(s):

RULES

This package adheres to the requirements in the folowing rule(s):