library(tidyverse)
# Toy data
df <- tibble(
x = c("123Abcde789",
"46765%-''098",
"565--456A",
"1232133456",
"'''890976")
)
df
#> # A tibble: 5 x 1
#> x
#> <chr>
#> 1 123Abcde789
#> 2 46765%-''098
#> 3 565--456A
#> 4 1232133456
#> 5 '''890976
How do I identify rows that contain special characters other than alphanumeric characters or -
? For example, desired code will identify rows 2 and 5 from df
because row 2 contains %''
and row 5 contains '''
.