Anchors for pattern

Usage

UNANCHORED
ANCHOR_START
ANCHOR_BOTH

Format

An object of class numeric of length 1.

Description

Anchors for regular expression pattern string.

Details

UNANCHORED - No anchoring

ANCHOR_START - Anchor at start only

ANCHOR_BOTH - Anchor at start and end

Examples

re2_match("This is an apple.", "(is)",anchor = ANCHOR_BOTH)
.match .1 [1,] NA NA
re2_match("This is an apple.", "(This)",anchor = ANCHOR_START)
.match .1 [1,] "This" "This"
re2_match("This is an apple.", "(is)",anchor = UNANCHORED)
.match .1 [1,] "is" "is"