regexr (version 1.1.0)

test: Test Regular Expression Validity

Description

Test regular expression validity of a regexr object.

Usage

test(x, quiet, ...)

Arguments

x
A regexr object.
quiet
logical. Should test print warnings about the concatenated expression and individual sub-expressions?
...
Ignored.

Value

Returns a list of two logical vectors. The first vector is a test of the concatenated expression. The second vector is a logical test of the validity of each sub-expressions that makes up the concatenated expression.

Examples

Run this code
m <- construct(
    space =
        "\\s+"
            %:)%"I see",

    simp =
        "(?<=(foo))",

    or =
        "(;|:)\\s*"
            %:)%"comment on what this does",

    "[a]s th[atey]"
)


test(m)
## Not run: 
# subs(m)[5:7] <- c("(", "([A-Z]|(\\d{5})", ")")
# test(m)
# ## End(Not run)

Run the code above in your browser using DataLab