Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Anchors

The start or end of a string.


Description

START matches the start of a string. END matches the end of a string. exactly makes the regular expression match the whole string, from start to end.

Usage

START

END

exactly(x)

Arguments

x

A character vector.

Format

An object of class regex (inherits from character) of length 1.

Value

A character vector representing part or all of a regular expression.

Note

Caret and dollar are used as start/end delimiters, since \A and \Z are not supported by R's internal PRCE engine or stringi's ICU engine.

References

See Also

Examples

START
END

# Usage
x <- c("catfish", "tomcat", "cat")
(rx_start <- START %R% "cat")
(rx_end <- "cat" %R% END)
(rx_exact <- exactly("cat"))
stringi::stri_detect_regex(x, rx_start)
stringi::stri_detect_regex(x, rx_end)
stringi::stri_detect_regex(x, rx_exact)

rebus.base

Core Functionality for the 'rebus' Package

v0.0-3
Unlimited
Authors
Richard Cotton [aut, cre]
Initial release
2017-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.