That is not a very selective regex.
Actually, a long "or" probably is best, but you don't have to type it in
directly.
prefixes <- c( "AD", "FN" )
pat <- paste0( "^(", paste( prefixes, collapse="|" ), ")[0-9]{4}$" )
grepl( pat, Identifier )
--
Sent from my phone. Please excuse my brevity.
On
Hello All,
I have a dataframe of about 1.5 million rows from this dataframe I need to
filter out identifiers. An example would be 07-07099, AD-AD0999, and
AL-AL, FN-FN. I am using grepl to identify those of interest
as follows:
grepl("^[FN]|[AD]{2}", Identifier)
Th
2 matches
Mail list logo