UNANCHORED: Anchors for pattern

Description Usage Format Details Examples

Description

Anchors for regular expression pattern string.

Usage

1
2
3
4
5

Format

An object of class numeric of length 1.

Details

UNANCHORED - No anchoring

ANCHOR_START - Anchor at start only

ANCHOR_BOTH - Anchor at start and end

Examples

1
2
3
4
5
re2_match("This is an apple.", "(is)",anchor = ANCHOR_BOTH)
re2_match("This is an apple.", "(is)",anchor = UNANCHORED)
re2_match("This is an apple.", "(is)",anchor = ANCHOR_START)
re2_match("This is an apple.", "(This)",anchor = ANCHOR_START)
re2_match("This is an apple.", "(This)",anchor = ANCHOR_BOTH)

Example output

     .match .1
[1,] NA     NA
     .match .1  
[1,] "is"   "is"
     .match .1
[1,] NA     NA
     .match .1    
[1,] "This" "This"
     .match .1
[1,] NA     NA

re2r documentation built on May 2, 2019, 12:35 p.m.