return which pattern matched

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"

Created on 2019-06-02 by the reprex package (v0.2.1)