Venus::Replace
Replace Class
Replace Class for Perl 5
method: captures method: count method: evaluate method: explain method: get method: initial method: last_match_end method: last_match_start method: matched method: named_captures method: prematched method: postmatched method: set
package main;
use Venus::Replace;
my $replace = Venus::Replace->new(
string => 'hello world',
regexp => '(world)',
substr => 'universe',
);
# $replace->captures;
This package provides methods for manipulating regexp replacement data.
Venus::Kind::Utility
Venus::Role::Explainable Venus::Role::Stashable
flags: rw, opt, Str, '' regexp: rw, opt, Regexp, qr// string: rw, opt, Str, '' substr: rw, opt, Str, ''
The captures method returns the capture groups from the result object which contains information about the results of the regular expression operation. This method can return a list of values in list-context.
captures() (ArrayRef)
{ since => '0.01', }
=example-1 captures
# given: synopsis;
my $captures = $replace->captures;
# ["world"]
The count method returns the number of match occurrences from the result object which contains information about the results of the regular expression operation.
count() (Num)
{ since => '0.01', }
=example-1 count
# given: synopsis;
my $count = $replace->count;
# 1
The evaluate method performs the regular expression operation and returns an arrayref representation of the results.
evaluate() (ArrayRef)
{ since => '0.01', }
=example-1 evaluate
# given: synopsis;
my $evaluate = $replace->evaluate;
# [
# "(world)",
# "hello universe",
# 1,
# [6, 6],
# [11, 11],
# {},
# "hello world",
# ]
The explain method returns the subject of the regular expression operation and is used in stringification operations.
explain() (Str)
{ since => '0.01', }
=example-1 explain
# given: synopsis;
my $explain = $replace->explain;
# "hello universe"
The get method returns the subject of the regular expression operation.
get() (Str)
{ since => '0.01', }
=example-1 get
# given: synopsis;
my $get = $replace->get;
# "hello universe"
The initial method returns the unaltered string from the result object which contains information about the results of the regular expression operation.
initial() (Str)
{ since => '0.01', }
=example-1 initial
# given: synopsis;
my $initial = $replace->initial;
# "hello world"
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_end() (Maybe[ArrayRef[Int]])
{ since => '0.01', }
=example-1 last_match_end
# given: synopsis;
my $last_match_end = $replace->last_match_end;
# [11, 11]
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.
last_match_start() (Maybe[ArrayRef[Int]])
{ since => '0.01', }
=example-1 last_match_start
# given: synopsis;
my $last_match_start = $replace->last_match_start;
# [6, 6]
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.
matched() (Maybe[Str])
{ since => '0.01', }
=example-1 matched
# given: synopsis;
my $matched = $replace->matched;
# "world"
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.
named_captures() (HashRef)
{ since => '0.01', }
=example-1 named_captures
# given: synopsis;
my $named_captures = $replace->named_captures;
# {}
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.
prematched() (Maybe[Str)
{ since => '0.01', }
=example-1 prematched
# given: synopsis;
my $prematched = $replace->prematched;
# "hello "
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.
postmatched() (Maybe[Str)
{ since => '0.01', }
=example-1 postmatched
# given: synopsis;
my $postmatched = $replace->postmatched;
# ""
The set method sets the subject of the regular expression operation.
set(Str $data) (Str)
{ since => '0.01', }
=example-1 set
# given: synopsis;
my $set = $replace->set('hello universe');
# "hello universe"
This package overloads the . operator.
This package overloads the eq operator.
This package overloads the ne operator.
This package overloads the qr operator.
This package overloads the "" operator.
This package overloads the ~~ operator.
t/Venus.t: pdml: authors t/Venus.t: pdml: license
64 POD Errors
The following errors were encountered while parsing the POD:
- Around line 13:
Unknown directive: =name
- Around line 21:
Unknown directive: =tagline
- Around line 29:
Unknown directive: =abstract
- Around line 37:
Unknown directive: =includes
- Around line 57:
Unknown directive: =synopsis
- Around line 80:
Unknown directive: =description
- Around line 88:
Unknown directive: =inherits
- Around line 96:
Unknown directive: =integrates
- Around line 105:
Unknown directive: =attributes
- Around line 116:
Unknown directive: =method
- Around line 122:
Unknown directive: =signature
- Around line 126:
Unknown directive: =metadata
- Around line 150:
Unknown directive: =method
- Around line 156:
Unknown directive: =signature
- Around line 160:
Unknown directive: =metadata
- Around line 184:
Unknown directive: =method
- Around line 189:
Unknown directive: =signature
- Around line 193:
Unknown directive: =metadata
- Around line 249:
=cut found outside a pod block. Skipping to next block.
- Around line 260:
Unknown directive: =method
- Around line 265:
Unknown directive: =signature
- Around line 269:
Unknown directive: =metadata
- Around line 293:
Unknown directive: =method
- Around line 297:
Unknown directive: =signature
- Around line 301:
Unknown directive: =metadata
- Around line 325:
Unknown directive: =method
- Around line 330:
Unknown directive: =signature
- Around line 334:
Unknown directive: =metadata
- Around line 358:
Unknown directive: =method
- Around line 364:
Unknown directive: =signature
- Around line 368:
Unknown directive: =metadata
- Around line 392:
Unknown directive: =method
- Around line 398:
Unknown directive: =signature
- Around line 402:
Unknown directive: =metadata
- Around line 426:
Unknown directive: =method
- Around line 432:
Unknown directive: =signature
- Around line 436:
Unknown directive: =metadata
- Around line 460:
Unknown directive: =method
- Around line 466:
Unknown directive: =signature
- Around line 470:
Unknown directive: =metadata
- Around line 510:
=cut found outside a pod block. Skipping to next block.
- Around line 520:
Unknown directive: =method
- Around line 526:
Unknown directive: =signature
- Around line 530:
Unknown directive: =metadata
- Around line 554:
Unknown directive: =method
- Around line 560:
Unknown directive: =signature
- Around line 564:
Unknown directive: =metadata
- Around line 588:
Unknown directive: =method
- Around line 592:
Unknown directive: =signature
- Around line 596:
Unknown directive: =metadata
- Around line 620:
Unknown directive: =operator
- Around line 636:
=cut found outside a pod block. Skipping to next block.
- Around line 646:
Unknown directive: =operator
- Around line 662:
=cut found outside a pod block. Skipping to next block.
- Around line 672:
Unknown directive: =operator
- Around line 688:
=cut found outside a pod block. Skipping to next block.
- Around line 698:
Unknown directive: =operator
- Around line 714:
=cut found outside a pod block. Skipping to next block.
- Around line 724:
Unknown directive: =operator
- Around line 740:
=cut found outside a pod block. Skipping to next block.
- Around line 758:
=cut found outside a pod block. Skipping to next block.
- Around line 768:
Unknown directive: =operator
- Around line 784:
=cut found outside a pod block. Skipping to next block.
- Around line 790:
Unknown directive: =partials