Hello @siddharthprabhu,
Thanks for reverting quickly. I tried what you suggested. It still didn't work. Below is the reprex.
Kindly point out if there is a silly syntax mistake.
library(reprex)
library(tidyverse)
#> Warning: package 'dplyr' was built under R version 3.6.3
#> Warning: package 'forcats' was built under R version 3.6.3
tibble(
a = c(1,2,1,3,5,8),
b = c(1,2,3,4,5,6),
a_11 = c(7,8,9,4,5,6)
) -> temp
## ends_with works with simple charasters
temp %>%
select(ends_with("a")) %>% names()
#> [1] "a"
## ends with does not work with regex
temp %>%
select(ends_with(paste("_[:digit:]{1,}"))) %>% names()
#> character(0)
temp %>%
select(ends_with("_[:digit:]{1,}")) %>% names()
#> character(0)
## checking if regex is correect
str_detect(names(temp),"_[:digit:]{1,}" )
#> [1] FALSE FALSE TRUE
## Trying matches funciton
temp %>%
select(matches("_[:digit:]{1,}")) %>% names()
#> character(0)
temp %>%
select(matches("_[:digit:]{1,}$")) %>% names() ## Not sure if this is whatwas meant by adding a '$'
#> character(0)
Created on 2020-04-27 by the reprex package (v0.3.0)