Learn R Programming

ore (version 1.7.4.1)

matches: Extract matching substrings

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

matches(object, ...)

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

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

# S3 method for default matches(object, ...)

groups(object, ...)

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

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

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

# S3 method for default groups(object, ...)

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.

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?

See Also

ore_search