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: new 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::Encaseable Venus::Role::Explainable
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 new method constructs an instance of the package.
new(any @args) (Venus::Search)
{ since => '4.15', }
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"
package main;
use Venus::Search;
my $search = Venus::Search->new(
string => 'hello world',
regexp => 'world',
flags => 'i',
);
$search->evaluate;
$search->flags('q');
$search->evaluate;
# Error! (on.evaluate)
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: present: authors t/Venus.t: present: license
70 POD Errors
The following errors were encountered while parsing the POD:
- Around line 14:
Unknown directive: =name
- Around line 22:
Unknown directive: =tagline
- Around line 30:
Unknown directive: =abstract
- Around line 38:
Unknown directive: =includes
- Around line 59:
Unknown directive: =synopsis
- Around line 81:
Unknown directive: =description
- Around line 89:
Unknown directive: =inherits
- Around line 97:
Unknown directive: =integrates
- Around line 106:
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 155:
Unknown directive: =signature
- Around line 159:
Unknown directive: =metadata
- Around line 198:
=cut found outside a pod block. Skipping to next block.
- Around line 209:
Unknown directive: =method
- Around line 214:
Unknown directive: =signature
- Around line 218:
Unknown directive: =metadata
- Around line 242:
Unknown directive: =method
- Around line 246:
Unknown directive: =signature
- Around line 250:
Unknown directive: =metadata
- Around line 274:
Unknown directive: =method
- Around line 279:
Unknown directive: =signature
- Around line 283:
Unknown directive: =metadata
- Around line 307:
Unknown directive: =method
- Around line 312:
Unknown directive: =signature
- Around line 316:
Unknown directive: =metadata
- Around line 340:
Unknown directive: =method
- Around line 346:
Unknown directive: =signature
- Around line 350:
Unknown directive: =metadata
- Around line 374:
Unknown directive: =method
- Around line 380:
Unknown directive: =signature
- Around line 384:
Unknown directive: =metadata
- Around line 408:
Unknown directive: =method
- Around line 414:
Unknown directive: =signature
- Around line 418:
Unknown directive: =metadata
- Around line 442:
Unknown directive: =method
- Around line 448:
Unknown directive: =signature
- Around line 452:
Unknown directive: =metadata
- Around line 491:
=cut found outside a pod block. Skipping to next block.
- Around line 501:
Unknown directive: =method
- Around line 505:
Unknown directive: =signature
- Around line 509:
Unknown directive: =metadata
- Around line 527:
=cut found outside a pod block. Skipping to next block.
- Around line 552:
=cut found outside a pod block. Skipping to next block.
- Around line 564:
Unknown directive: =method
- Around line 570:
Unknown directive: =signature
- Around line 574:
Unknown directive: =metadata
- Around line 598:
Unknown directive: =method
- Around line 604:
Unknown directive: =signature
- Around line 608:
Unknown directive: =metadata
- Around line 632:
Unknown directive: =method
- Around line 636:
Unknown directive: =signature
- Around line 640:
Unknown directive: =metadata
- Around line 664:
Unknown directive: =raise
- Around line 694:
Unknown directive: =operator
- Around line 710:
=cut found outside a pod block. Skipping to next block.
- Around line 720:
Unknown directive: =operator
- Around line 736:
=cut found outside a pod block. Skipping to next block.
- Around line 746:
Unknown directive: =operator
- Around line 762:
=cut found outside a pod block. Skipping to next block.
- Around line 772:
Unknown directive: =operator
- Around line 788:
=cut found outside a pod block. Skipping to next block.
- Around line 798:
Unknown directive: =operator
- Around line 814:
=cut found outside a pod block. Skipping to next block.
- Around line 832:
=cut found outside a pod block. Skipping to next block.
- Around line 842:
Unknown directive: =operator
- Around line 858:
=cut found outside a pod block. Skipping to next block.
- Around line 864:
Unknown directive: =partials