Venus::Regexp
Regexp Class
Regexp Class for Perl 5
method: cast method: default method: eq method: ge method: gele method: gt method: gtlt method: le method: lt method: ne method: numified method: replace method: search method: stringified method: tv
package main;
use Venus::Regexp;
my $regexp = Venus::Regexp->new(
qr/(?<greet>\w+) (?<username>\w+)/u,
);
# $regexp->search;
This package provides methods for manipulating regexp data.
Venus::Kind::Value
The cast method converts "value" objects between different "value" object types, based on the name of the type provided. This method will return undef if the invocant is not a Venus::Kind::Value.
cast(string $kind) (object | undef)
{ since => '0.08', }
=example-1 cast
package main;
use Venus::Regexp;
my $regexp = Venus::Regexp->new;
my $cast = $regexp->cast('array');
# bless({ value => [qr/(?^u:)/] }, "Venus::Array")
The default method returns the default value, i.e. qr//.
default() (regexp)
{ since => '0.01', }
=example-1 default
# given: synopsis;
my $default = $regexp->default;
# qr/(?^u:)/
The eq method performs an "equals" operation using the argument provided.
eq(any $arg) (boolean)
{ since => '0.08', }
=example-1 eq
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->eq($rvalue);
# 0
The ge method performs a "greater-than-or-equal-to" operation using the argument provided.
ge(any $arg) (boolean)
{ since => '0.08', }
=example-1 ge
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->ge($rvalue);
# 1
The gele method performs a "greater-than-or-equal-to" operation on the 1st argument, and "lesser-than-or-equal-to" operation on the 2nd argument.
gele(any $arg1, any $arg2) (boolean)
{ since => '0.08', }
=example-1 gele
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->gele($rvalue);
# 0
The gt method performs a "greater-than" operation using the argument provided.
gt(any $arg) (boolean)
{ since => '0.08', }
=example-1 gt
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->gt($rvalue);
# 1
The gtlt method performs a "greater-than" operation on the 1st argument, and "lesser-than" operation on the 2nd argument.
gtlt(any $arg1, any $arg2) (boolean)
{ since => '0.08', }
=example-1 gtlt
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->gtlt($rvalue);
# 0
The le method performs a "lesser-than-or-equal-to" operation using the argument provided.
le(any $arg) (boolean)
{ since => '0.08', }
=example-1 le
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->le($rvalue);
# 0
The lt method performs a "lesser-than" operation using the argument provided.
lt(any $arg) (boolean)
{ since => '0.08', }
=example-1 lt
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->lt($rvalue);
# 0
The ne method performs a "not-equal-to" operation using the argument provided.
ne(any $arg) (boolean)
{ since => '0.08', }
=example-1 ne
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->ne($rvalue);
# 1
The numified method returns the numerical representation of the object. For regexp objects the method returns the length (or character count) of the stringified object.
numified() (number)
{ since => '0.08', }
=example-1 numified
# given: synopsis;
my $numified = $regexp->numified;
# 36
The replace method performs a regular expression substitution on the given string. The first argument is the string to match against. The second argument is the replacement string. The optional third argument might be a string representing flags to append to the s///x operator, such as 'g' or 'e'. This method will always return a Venus::Replace object which can be used to introspect the result of the operation.
replace(string $string, string $substr, string $flags) (Venus::Replace)
{ since => '0.01', }
=example-1 replace
package main;
use Venus::Regexp;
my $regexp = Venus::Regexp->new(
qr/(?<username>\w+)$/,
);
my $replace = $regexp->replace('Hey, unknown', 'awncorp');
# bless({ ... }, 'Venus::Replace')
The search method performs a regular expression match against the given string, this method will always return a Venus::Search object which can be used to introspect the result of the operation.
search(string $string) (Venus::Search)
{ since => '0.01', }
=example-1 search
package main;
use Venus::Regexp;
my $regexp = Venus::Regexp->new(
qr/(?<greet>\w+), (?<username>\w+)/,
);
my $search = $regexp->search('hey, awncorp');
# bless({ ... }, 'Venus::Search')
The stringified method returns the object, stringified (i.e. a dump of the object's value).
stringified() (string)
{ since => '0.08', }
=example-1 stringified
# given: synopsis;
my $stringified = $regexp->stringified;
# qr/(?<greet>\w+) (?<username>\w+)/u
The tv method performs a "type-and-value-equal-to" operation using argument provided.
tv(any $arg) (boolean)
{ since => '0.08', }
=example-1 tv
package main;
use Venus::Array;
use Venus::Regexp;
my $lvalue = Venus::Regexp->new;
my $rvalue = Venus::Array->new;
my $result = $lvalue->tv($rvalue);
# 0
This package overloads the eq operator.
This package overloads the ne operator.
This package overloads the qr operator.
t/Venus.t: present: authors t/Venus.t: present: license
142 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 59:
Unknown directive: =synopsis
- Around line 80:
Unknown directive: =description
- Around line 88:
Unknown directive: =inherits
- Around line 96:
Unknown directive: =method
- Around line 102:
Unknown directive: =signature
- Around line 106:
Unknown directive: =metadata
- Around line 148:
=cut found outside a pod block. Skipping to next block.
- Around line 172:
=cut found outside a pod block. Skipping to next block.
- Around line 196:
=cut found outside a pod block. Skipping to next block.
- Around line 220:
=cut found outside a pod block. Skipping to next block.
- Around line 244:
=cut found outside a pod block. Skipping to next block.
- Around line 268:
=cut found outside a pod block. Skipping to next block.
- Around line 292:
=cut found outside a pod block. Skipping to next block.
- Around line 316:
=cut found outside a pod block. Skipping to next block.
- Around line 340:
=cut found outside a pod block. Skipping to next block.
- Around line 351:
Unknown directive: =method
- Around line 355:
Unknown directive: =signature
- Around line 359:
Unknown directive: =metadata
- Around line 383:
Unknown directive: =method
- Around line 387:
Unknown directive: =signature
- Around line 391:
Unknown directive: =metadata
- Around line 435:
=cut found outside a pod block. Skipping to next block.
- Around line 459:
=cut found outside a pod block. Skipping to next block.
- Around line 483:
=cut found outside a pod block. Skipping to next block.
- Around line 507:
=cut found outside a pod block. Skipping to next block.
- Around line 530:
=cut found outside a pod block. Skipping to next block.
- Around line 554:
=cut found outside a pod block. Skipping to next block.
- Around line 578:
=cut found outside a pod block. Skipping to next block.
- Around line 602:
=cut found outside a pod block. Skipping to next block.
- Around line 612:
Unknown directive: =method
- Around line 617:
Unknown directive: =signature
- Around line 621:
Unknown directive: =metadata
- Around line 665:
=cut found outside a pod block. Skipping to next block.
- Around line 689:
=cut found outside a pod block. Skipping to next block.
- Around line 713:
=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 760:
=cut found outside a pod block. Skipping to next block.
- Around line 784:
=cut found outside a pod block. Skipping to next block.
- Around line 808:
=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: =method
- Around line 847:
Unknown directive: =signature
- Around line 851:
Unknown directive: =metadata
- Around line 895:
=cut found outside a pod block. Skipping to next block.
- Around line 919:
=cut found outside a pod block. Skipping to next block.
- Around line 943:
=cut found outside a pod block. Skipping to next block.
- Around line 967:
=cut found outside a pod block. Skipping to next block.
- Around line 990:
=cut found outside a pod block. Skipping to next block.
- Around line 1014:
=cut found outside a pod block. Skipping to next block.
- Around line 1038:
=cut found outside a pod block. Skipping to next block.
- Around line 1062:
=cut found outside a pod block. Skipping to next block.
- Around line 1072:
Unknown directive: =method
- Around line 1076:
Unknown directive: =signature
- Around line 1080:
Unknown directive: =metadata
- Around line 1124:
=cut found outside a pod block. Skipping to next block.
- Around line 1148:
=cut found outside a pod block. Skipping to next block.
- Around line 1172:
=cut found outside a pod block. Skipping to next block.
- Around line 1196:
=cut found outside a pod block. Skipping to next block.
- Around line 1219:
=cut found outside a pod block. Skipping to next block.
- Around line 1243:
=cut found outside a pod block. Skipping to next block.
- Around line 1267:
=cut found outside a pod block. Skipping to next block.
- Around line 1291:
=cut found outside a pod block. Skipping to next block.
- Around line 1301:
Unknown directive: =method
- Around line 1306:
Unknown directive: =signature
- Around line 1310:
Unknown directive: =metadata
- Around line 1354:
=cut found outside a pod block. Skipping to next block.
- Around line 1378:
=cut found outside a pod block. Skipping to next block.
- Around line 1402:
=cut found outside a pod block. Skipping to next block.
- Around line 1426:
=cut found outside a pod block. Skipping to next block.
- Around line 1449:
=cut found outside a pod block. Skipping to next block.
- Around line 1473:
=cut found outside a pod block. Skipping to next block.
- Around line 1497:
=cut found outside a pod block. Skipping to next block.
- Around line 1521:
=cut found outside a pod block. Skipping to next block.
- Around line 1531:
Unknown directive: =method
- Around line 1536:
Unknown directive: =signature
- Around line 1540:
Unknown directive: =metadata
- Around line 1584:
=cut found outside a pod block. Skipping to next block.
- Around line 1608:
=cut found outside a pod block. Skipping to next block.
- Around line 1632:
=cut found outside a pod block. Skipping to next block.
- Around line 1656:
=cut found outside a pod block. Skipping to next block.
- Around line 1679:
=cut found outside a pod block. Skipping to next block.
- Around line 1703:
=cut found outside a pod block. Skipping to next block.
- Around line 1727:
=cut found outside a pod block. Skipping to next block.
- Around line 1751:
=cut found outside a pod block. Skipping to next block.
- Around line 1761:
Unknown directive: =method
- Around line 1765:
Unknown directive: =signature
- Around line 1769:
Unknown directive: =metadata
- Around line 1813:
=cut found outside a pod block. Skipping to next block.
- Around line 1837:
=cut found outside a pod block. Skipping to next block.
- Around line 1861:
=cut found outside a pod block. Skipping to next block.
- Around line 1885:
=cut found outside a pod block. Skipping to next block.
- Around line 1908:
=cut found outside a pod block. Skipping to next block.
- Around line 1932:
=cut found outside a pod block. Skipping to next block.
- Around line 1956:
=cut found outside a pod block. Skipping to next block.
- Around line 1980:
=cut found outside a pod block. Skipping to next block.
- Around line 1990:
Unknown directive: =method
- Around line 1994:
Unknown directive: =signature
- Around line 1998:
Unknown directive: =metadata
- Around line 2042:
=cut found outside a pod block. Skipping to next block.
- Around line 2066:
=cut found outside a pod block. Skipping to next block.
- Around line 2090:
=cut found outside a pod block. Skipping to next block.
- Around line 2114:
=cut found outside a pod block. Skipping to next block.
- Around line 2137:
=cut found outside a pod block. Skipping to next block.
- Around line 2161:
=cut found outside a pod block. Skipping to next block.
- Around line 2185:
=cut found outside a pod block. Skipping to next block.
- Around line 2209:
=cut found outside a pod block. Skipping to next block.
- Around line 2219:
Unknown directive: =method
- Around line 2225:
Unknown directive: =signature
- Around line 2229:
Unknown directive: =metadata
- Around line 2267:
=cut found outside a pod block. Skipping to next block.
- Around line 2277:
Unknown directive: =method
- Around line 2286:
Unknown directive: =signature
- Around line 2290:
Unknown directive: =metadata
- Around line 2320:
Unknown directive: =method
- Around line 2326:
Unknown directive: =signature
- Around line 2330:
Unknown directive: =metadata
- Around line 2360:
Unknown directive: =method
- Around line 2365:
Unknown directive: =signature
- Around line 2369:
Unknown directive: =metadata
- Around line 2408:
=cut found outside a pod block. Skipping to next block.
- Around line 2418:
Unknown directive: =method
- Around line 2423:
Unknown directive: =signature
- Around line 2427:
Unknown directive: =metadata
- Around line 2471:
=cut found outside a pod block. Skipping to next block.
- Around line 2495:
=cut found outside a pod block. Skipping to next block.
- Around line 2519:
=cut found outside a pod block. Skipping to next block.
- Around line 2543:
=cut found outside a pod block. Skipping to next block.
- Around line 2566:
=cut found outside a pod block. Skipping to next block.
- Around line 2590:
=cut found outside a pod block. Skipping to next block.
- Around line 2614:
=cut found outside a pod block. Skipping to next block.
- Around line 2638:
=cut found outside a pod block. Skipping to next block.
- Around line 2648:
Unknown directive: =operator
- Around line 2664:
=cut found outside a pod block. Skipping to next block.
- Around line 2674:
Unknown directive: =operator
- Around line 2690:
=cut found outside a pod block. Skipping to next block.
- Around line 2700:
Unknown directive: =operator
- Around line 2716:
=cut found outside a pod block. Skipping to next block.
- Around line 2726:
Unknown directive: =partials