Anchors

0th

Percentile

The start or end of a string.

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.

Keywords
datasets
Usage
START

END

exactly(x)

Arguments
x
A character vector.
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.

Format

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

References

http://www.regular-expressions.info/anchors.html and http://www.rexegg.com/regex-anchors.html

See Also

whole_word and modify_mode

Aliases
  • Anchors
  • START
  • END
  • exactly
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)
Documentation reproduced from package rebus.base, version 0.0-3, License: Unlimited

Community examples

Looks like there are no examples yet.