Adds the ^ anchor to the beginning of the pattern, ensuring the match must start at the very first character of the string.

xp_wrap_start(pattern)

Arguments

pattern

A regexpert object or character string from the pipe.

Value

A regexpert object.

Examples

# Match "Hello" only if it's at the very start
xp_build_literal("Hello") %>% xp_wrap_start()
#> <regexpert pattern>
#>   ^Hello