If the code below does not do what you want, please provide more details preferably in the form of a Reproducible Example.
library(stringr)
library(purrr)
#> Warning: package 'purrr' was built under R version 3.5.3
A1='stringishere'
A2='stre|st.*re'
Pieces <- str_split(A2, "\\|")[[1]]
Pieces[map_lgl(Pieces, grepl, A1)]
#> [1] "st.*re"