matches: Extract matching substrings

Description Usage Arguments Value See Also

Description

These functions extract entire matches, or just subgroup matches, from objects of class "orematch". They can also be applied to lists of these objects, as returned by ore_search when more than one string is searched. For other objects they return NA.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
matches(object, ...)

## S3 method for class 'orematches'
matches(object, simplify = TRUE, ...)

## S3 method for class 'orematch'
matches(object, ...)

## Default S3 method:
matches(object, ...)

groups(object, ...)

## S3 method for class 'orematches'
groups(object, simplify = TRUE, ...)

## S3 method for class 'orematch'
groups(object, ...)

## S3 method for class 'orearg'
groups(object, ...)

## Default S3 method:
groups(object, ...)

Arguments

object

An R object. Methods are provided for generic lists and "orematch" objects. If no object is provided (i.e. the method is called with no arguments), the value of ore_lastmatch will be used as a default.

...

Further arguments to methods.

simplify

For the list methods, should nonmatching elements be removed from the result?

Value

A vector, matrix, array, or list of the same, containing full matches or subgroups. If simplify is TRUE, the result may have a dropped attribute, giving the indices of nonmatching elements.

See Also

ore_search


ore documentation built on Nov. 2, 2021, 5:08 p.m.

Related to matches in ore...