I would like to search for a text ('needle') if it exists within another text ('haystack') with the following two conditions:
Examples:
Moreover 'cde' is not a constant string, instead a variable iterated over a list.
Any elegant solution in python or R or bash would be appreciated.
I got the solution in python:
re.match('.*'+'.*'.join(list(needle))+'.*',(haystack))