Venus::Search

Search Class

Search Class for Perl 5

method: captures method: evaluate method: explain method: get method: count 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::Search;

my $search = Venus::Search->new(
  string => 'hello world',
  regexp => '(hello)',
);

# $search->captures;

This package provides methods for manipulating regexp search data.

Venus::Kind::Utility

Venus::Role::Explainable Venus::Role::Stashable

flags: rw, opt, Str, '' regexp: rw, opt, Regexp, qr// string: 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 = $search->captures;

# ["hello"]

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 = $search->evaluate;

# ["(hello)", "hello world", 1, [0, 0], [5, 5], {}, "hello world"]

The explain method returns the subject of the regular expression operation and is used in stringification operations.

explain() (string)

{ since => '0.01', }

=example-1 explain

# given: synopsis;

my $explain = $search->explain;

# "hello world"

The get method returns the subject of the regular expression operation.

get() (string)

{ since => '0.01', }

=example-1 get

# given: synopsis;

my $get = $search->get;

# "hello world"

The count method returns the number of matches found in the result object which contains information about the results of the regular expression operation.

count() (number)

{ since => '0.01', }

=example-1 count

# given: synopsis;

my $count = $search->count;

# 1

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

initial() (string)

{ since => '0.01', }

=example-1 initial

# given: synopsis;

my $initial = $search->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[within[arrayref, number]])

{ since => '0.01', }

=example-1 last_match_end

# given: synopsis;

my $last_match_end = $search->last_match_end;

# [5, 5]

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[within[arrayref, number]])

{ since => '0.01', }

=example-1 last_match_start

# given: synopsis;

my $last_match_start = $search->last_match_start;

# [0, 0]

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[string])

{ since => '0.01', }

=example-1 matched

# given: synopsis;

my $matched = $search->matched;

# "hello"

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 = $search->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[string])

{ since => '0.01', }

=example-1 prematched

# given: synopsis;

my $prematched = $search->prematched;

# ""

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[string])

{ since => '0.01', }

=example-1 postmatched

# given: synopsis;

my $postmatched = $search->postmatched;

# " world"

The set method sets the subject of the regular expression operation.

set(string $string) (string)

{ since => '0.01', }

=example-1 set

# given: synopsis;

my $set = $search->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.

This package may raise an error_on_evaluate exception.

t/Venus.t: present: authors t/Venus.t: present: license

66 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 79:

Unknown directive: =description

Around line 87:

Unknown directive: =inherits

Around line 95:

Unknown directive: =integrates

Around line 104:

Unknown directive: =attributes

Around line 114:

Unknown directive: =method

Around line 120:

Unknown directive: =signature

Around line 124:

Unknown directive: =metadata

Around line 148:

Unknown directive: =method

Around line 153:

Unknown directive: =signature

Around line 157:

Unknown directive: =metadata

Around line 196:

=cut found outside a pod block. Skipping to next block.

Around line 207:

Unknown directive: =method

Around line 212:

Unknown directive: =signature

Around line 216:

Unknown directive: =metadata

Around line 240:

Unknown directive: =method

Around line 244:

Unknown directive: =signature

Around line 248:

Unknown directive: =metadata

Around line 272:

Unknown directive: =method

Around line 277:

Unknown directive: =signature

Around line 281:

Unknown directive: =metadata

Around line 305:

Unknown directive: =method

Around line 310:

Unknown directive: =signature

Around line 314:

Unknown directive: =metadata

Around line 338:

Unknown directive: =method

Around line 344:

Unknown directive: =signature

Around line 348:

Unknown directive: =metadata

Around line 372:

Unknown directive: =method

Around line 378:

Unknown directive: =signature

Around line 382:

Unknown directive: =metadata

Around line 406:

Unknown directive: =method

Around line 412:

Unknown directive: =signature

Around line 416:

Unknown directive: =metadata

Around line 440:

Unknown directive: =method

Around line 446:

Unknown directive: =signature

Around line 450:

Unknown directive: =metadata

Around line 489:

=cut found outside a pod block. Skipping to next block.

Around line 499:

Unknown directive: =method

Around line 505:

Unknown directive: =signature

Around line 509:

Unknown directive: =metadata

Around line 533:

Unknown directive: =method

Around line 539:

Unknown directive: =signature

Around line 543:

Unknown directive: =metadata

Around line 567:

Unknown directive: =method

Around line 571:

Unknown directive: =signature

Around line 575:

Unknown directive: =metadata

Around line 599:

Unknown directive: =operator

Around line 615:

=cut found outside a pod block. Skipping to next block.

Around line 625:

Unknown directive: =operator

Around line 641:

=cut found outside a pod block. Skipping to next block.

Around line 651:

Unknown directive: =operator

Around line 667:

=cut found outside a pod block. Skipping to next block.

Around line 677:

Unknown directive: =operator

Around line 693:

=cut found outside a pod block. Skipping to next block.

Around line 703:

Unknown directive: =operator

Around line 719:

=cut found outside a pod block. Skipping to next block.

Around line 737:

=cut found outside a pod block. Skipping to next block.

Around line 747:

Unknown directive: =operator

Around line 763:

=cut found outside a pod block. Skipping to next block.

Around line 769:

Unknown directive: =error

Around line 796:

=cut found outside a pod block. Skipping to next block.

Around line 810:

Unknown directive: =partials