Grab Regular Expressions from Dictionaries

Description

convenience function to

Usage

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

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.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
grab("@rm_white")
## Not run: 
## Throws an error
grab("@foo")

## End(Not run)
cat(grab("@pages2"))
## Not run: 
cat(grab("@pages2"), file="clipboard")

## End(Not run)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.