Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

regex in R

x <- "1888 is the longest year in Roman numerals: MDCCCLXXXVIII"
str_extract(x, "CC?")
#> [1] "CC"
str_extract(x, "CC+")
#> [1] "CCC"
str_extract(x, 'C[LX]+')
#> [1] "CLXXX"
Source by stringr.tidyverse.org #
 
PREVIOUS NEXT
Tagged: #regex #R
ADD COMMENT
Topic
Name
6+5 =