perl_flavor {mclm}R Documentation

Retrieve or set the flavor of a regular expression

Description

These functions retrieve or set the perl property of an object of class re.

Usage

perl_flavor(x)

perl_flavor(x) <- value

Arguments

x

Object of class re.

value

Logical.

Details

The assignment function merely sets the perl property so that the x attribute is read as an expression using the PCRE flavor of regular expression (when perl = TRUE) or not (when perl = FALSE). The regular expression itself is not modified: if perl is set to an inappropriate value, the regular expression will no longer function properly in any of the functions that support re objects.

Value

A logical vector of length 1.

Examples

(regex <- re("^.{3,}"))
perl_flavor(regex)

perl_flavor(regex) <- FALSE
perl_flavor(regex)
regex

perl_flavor(regex) <- TRUE
perl_flavor(regex)
regex

[Package mclm version 0.2.7 Index]