NAME

Data::Object::Search

ABSTRACT

Search Class for Perl 5

SYNOPSIS

package main;

use Data::Object::Search;

my $search = Data::Object::Search->new([
  '(?^:(test))',
  'this is a test',
  1,
  [
    10,
    10
  ],
  [
    14,
    14
  ],
  {},
  'this is a test'
]);

DESCRIPTION

This package provides methods for manipulating search data.

INHERITS

This package inherits behaviors from:

Data::Object::Array

INTEGRATES

This package integrates behaviors from:

Data::Object::Role::Dumpable

Data::Object::Role::Proxyable

Data::Object::Role::Throwable

LIBRARIES

This package uses type constraints from:

Data::Object::Types

METHODS

This package implements the following methods:

captures

captures() : ArrayRef

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

captures example #1
# given: synopsis

$search->captures; # ['test']

count

count() : Num

The count 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..

count example #1
# given: synopsis

$search->count; # 1

initial

initial() : Str

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

initial example #1
# given: synopsis

$search->initial; # this is a test

last_match_end

last_match_end() : Maybe[ArrayRef[Int]]

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 example #1
# given: synopsis

$search->last_match_end; # [14, 14]

last_match_start

last_match_start() : Maybe[ArrayRef[Int]]

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 example #1
# given: synopsis

$search->last_match_start; # [10, 10]

matched

matched() : Maybe[Str]

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 example #1
# given: synopsis

$search->matched; # test

named_captures

named_captures() : HashRef

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 example #1
# given: synopsis

$search->named_captures; # {}

postmatched

postmatched() : Maybe[Str]

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 example #1
# given: synopsis

$search->postmatched; # ''

prematched

prematched() : Maybe[Str]

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 example #1
# given: synopsis

$search->prematched; # 'this is a '

regexp

regexp() : RegexpRef

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..

regexp example #1
# given: synopsis

$search->regexp; # qr/(test)/

string

string() : Str

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..

string example #1
# given: synopsis

$search->string; # this is a test

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues