is.regex: Test Regular Expression Validity

Description Usage Arguments Value See Also Examples

Description

Acts as a logical test of a regular expression's validity. is.regex uses gsub and tests for errors to determine a regular expression's validity. The regular expression must conform to R's regular expression rules (see ?regex for details about how R handles regular expressions).

Usage

1
is.regex(pattern)

Arguments

pattern

A regular expression to be tested.

Value

Returns a logical (TRUE is a valid regular expression).

See Also

gsub

Examples

1
2
3
4
5
is.regex("I|***")
is.regex("I|i")

sapply(regex_usa, is.regex)
sapply(regex_supplement, is.regex) ## `version` is not a valid regex


Search within the qdapRegex package
Search all R packages, documentation and source code

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.