Learn R Programming

searchable (version 0.1.2)

perl: Match modifiers

Description

Functions affecting how matching occurs. The modifiers can be applied to either the search pattern or the search target.

Usage

perl(object)

ignore.case(object)

fixed(object)

partial(object)

exact(object)

Arguments

object
string or target object to apply match modifiers to

Match modifiers control how a search pattern is matched against the search target. They can be applied to either the pattern or target. Modifiers applied to the search pattern take priority. If

ignore.case

Match modifier ignore.case performs case insensitive matching against the names of the target. ignore.case is incompatible with fixed. Application of ignore.case overrides previous calls to fixed.

perl

Match modifier perl performs matches against the targets names using PCREs. perl is incompatible with fixed. Application of perl overrides previous calls to fixed.

fixed

Match modifier fixed performs a fixed string match instead of using a regular expression. This can yield substantial speed ups, if regular expression matching is not needed. Fixed mathcing requires that the search target contains the search string. For exact matching of the search string see exact.

fixed is incompatible with perl and ignore.case. Application of fixed overrides previous calls to the others.

partial

This is a synonym for fixed

exact

Match modifier exact, clears all match modifiers and resets the R's normal exact matching to the target's names.

It is incompatible with all other match modifiers. Setting exact clears other match modifiers to FALSE.

See https://github.com/hadley/stringr/issues/55

References

https://github.com/hadley/stringr/issues/55 https://github.com/hadley/stringr/issues/60

See Also

extract fixed ignore.case perl

Examples

Run this code
exact( "string" )

Run the code above in your browser using DataLab