qdapRegex (version 0.7.2)

grab: Grab Regular Expressions from Dictionaries

Description

convenience function to

Usage

grab(pattern, dictionary = getOption("regex.library"))

Arguments

pattern

A character string starting with "@" that is a regular expression from a qdapRegex dictionary.

dictionary

A dictionary of canned regular expressions to search within.

Value

Returns a single string regular expression from one of the qdapRegex dictionaries.

Details

Many R regular expressions contain doubled backslashes that are not used in other regex interpreters. Using cat can remove backslash escapes (see Examples) or URLencode if using in a url.

Examples

Run this code
# NOT RUN {
grab("@rm_white")
# }
# NOT RUN {
## Throws an error
grab("@foo")
# }
# NOT RUN {
cat(grab("@pages2"))
# }
# NOT RUN {
cat(grab("@pages2"), file="clipboard")
# }

Run the code above in your browser using DataLab