We have set of sub strings t = (b6,b7,y7,y8)
and a main String K ='hgtb6ju\u'
.
I need to check whether any of the element in t
available in K
. If yes, which substring(s).
t = {'b6', 'b7', 'y7', 'y8', 'ju'};
K = 'hgtb6ju\u';
logidx = ~cellfun(@isempty,regexp(K,t)); %Finding if substrings are present
matched = t(logidx) % Finding which substrings are present