Learn R Programming

regexr (version 1.1.0)

get_construct: Extract Script from reverse_construct to construct a regexr Object.

Description

Pulls the reverse_construct attribute from a reverse_construct. This script can be assigned to an object and run in the console to create a comments, named regexr object.

Usage

get_construct(x, file = "", ...)

Arguments

x
A reverse_construct object.
file
A connection, or a character string naming the file to print to. If "" (the default), cat prints to the console unless redirected by sink. Windows users may use file = "clipboard" to copy the content to the clipboard.
...
Other arguments passed to print.reverse_construct.

Value

Returns an auto-commented script used to construct a regexr object.

Examples

Run this code
## Not run: 
# library("qdapRegex")
# (myregex <- grab("@rm_time2"))
# out <- as.regexr(myregex)
# 
# out
# summary(out)
# comments(out)
# subs(out)
# test(out)
# get_construct(out)
# 
# ## On Windows copy to clipboard
# get_construct(out, file="clipboard")
# ## End(Not run)

Run the code above in your browser using DataLab